no message
parent
d78b5e48ed
commit
5cdc1e3021
|
|
@ -21,9 +21,10 @@ public interface IAgvTaskService extends IService<AgvTask> {
|
|||
* @param endCode 终点
|
||||
* @param taskType 任务类型
|
||||
* @param type 业务类型
|
||||
* @param izAll 整托/拆托
|
||||
* @param agvVendor 供应商
|
||||
*/
|
||||
AgvTask createAgvTask(Long businessDetailId, String carrierCode, String startCode, String endCode, String taskType, String type, String agvVendor);
|
||||
AgvTask createAgvTask(Long businessDetailId, String carrierCode, String startCode, String endCode, String taskType, String type, Integer izAll, String agvVendor);
|
||||
|
||||
/**
|
||||
* 创建agvTask任务
|
||||
|
|
@ -34,8 +35,9 @@ public interface IAgvTaskService extends IService<AgvTask> {
|
|||
* @param endCode 终点
|
||||
* @param taskType 任务类型
|
||||
* @param type 业务类型
|
||||
* @param izAll 整托/拆托
|
||||
* @param agvVendor 供应商
|
||||
*/
|
||||
AgvTask bulidAgvTask(Long businessDetailId, String carrierCode, String startCode, String endCode, String taskType, String type, String agvVendor);
|
||||
AgvTask bulidAgvTask(Long businessDetailId, String carrierCode, String startCode, String endCode, String taskType, String type, Integer izAll, String agvVendor);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AgvTask createAgvTask(Long businessDetailId, String carrierCode, String startCode, String endCode, String taskType, String type, String agvVendor) {
|
||||
public AgvTask createAgvTask(Long businessDetailId, String carrierCode, String startCode, String endCode, String taskType, String type,Integer izAll, String agvVendor) {
|
||||
LoginUser sysUser = null;
|
||||
try {
|
||||
sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
|
@ -50,6 +50,7 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl
|
|||
.carrierType(StockTypeEnum.TRAY.getValue())
|
||||
.taskType(taskType)
|
||||
.priority(priority)
|
||||
.izAll(izAll)
|
||||
.agvVendor(agvVendor)
|
||||
.sysOrgCode(sysUser == null ? "A05" : sysUser.getOrgCode())
|
||||
.tenantId(sysUser == null ? 1000L : Long.parseLong(sysUser.getRelTenantIds()))
|
||||
|
|
@ -60,7 +61,7 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl
|
|||
}
|
||||
|
||||
@Override
|
||||
public AgvTask bulidAgvTask(Long businessDetailId, String carrierCode, String startCode, String endCode, String taskType, String type, String agvVendor) {
|
||||
public AgvTask bulidAgvTask(Long businessDetailId, String carrierCode, String startCode, String endCode, String taskType, String type,Integer izAll, String agvVendor) {
|
||||
LoginUser sysUser = null;
|
||||
try {
|
||||
sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
|
@ -81,6 +82,7 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl
|
|||
.carrierType(StockTypeEnum.TRAY.getValue())
|
||||
.taskType(taskType)
|
||||
.priority(priority)
|
||||
.izAll(izAll)
|
||||
.agvVendor(agvVendor)
|
||||
.sysOrgCode(sysUser == null ? "A05" : sysUser.getOrgCode())
|
||||
.tenantId(sysUser == null ? 1000L : Long.parseLong(sysUser.getRelTenantIds()))
|
||||
|
|
|
|||
|
|
@ -61,16 +61,16 @@ public class Point implements Serializable {
|
|||
@Dict(dicCode = "common_status")
|
||||
private java.lang.Integer status;
|
||||
/**
|
||||
* 排
|
||||
* 库位深度
|
||||
*/
|
||||
@Excel(name = "排", width = 15)
|
||||
@Schema(description = "排")
|
||||
@Excel(name = "库位深度", width = 15)
|
||||
@Schema(description = "库位深度")
|
||||
private java.lang.String rowNum;
|
||||
/**
|
||||
* 列
|
||||
* 列-巷道编号
|
||||
*/
|
||||
@Excel(name = "列", width = 15)
|
||||
@Schema(description = "列")
|
||||
@Excel(name = "巷道编号", width = 15)
|
||||
@Schema(description = "巷道编号")
|
||||
private java.lang.String colNum;
|
||||
/**
|
||||
* 层
|
||||
|
|
@ -78,6 +78,26 @@ public class Point implements Serializable {
|
|||
@Excel(name = "层", width = 15)
|
||||
@Schema(description = "层")
|
||||
private java.lang.String layerNum;
|
||||
|
||||
/**
|
||||
* 位置坐标x
|
||||
*/
|
||||
@Excel(name = "位置坐标x", width = 15)
|
||||
@Schema(description = "位置坐标x")
|
||||
private java.lang.Integer positionX;
|
||||
|
||||
/**
|
||||
* 位置坐标y
|
||||
*/
|
||||
@Excel(name = "位置坐标y", width = 15)
|
||||
@Schema(description = "位置坐标y")
|
||||
private java.lang.Integer positionY;
|
||||
|
||||
/**
|
||||
* 是否双通道
|
||||
*/
|
||||
@Schema(description = "是否双通道")
|
||||
private Integer izDoubleLane;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -8,15 +8,14 @@ import java.math.BigDecimal;
|
|||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.*;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
|
|
@ -25,10 +24,11 @@ import lombok.experimental.Accessors;
|
|||
* @Date: 2025-10-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_stock")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Schema(description = "容器")
|
||||
public class Stock implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
|||
|
|
@ -32,4 +32,21 @@ public interface PointMapper extends BaseMapper<Point> {
|
|||
* @return List<Point>
|
||||
*/
|
||||
List<Point> queryPoints(@Param("pointCode") String pointCode, @Param("status") Integer status, @Param("areaCode") String areaCode);
|
||||
|
||||
/**
|
||||
* 查询同SKU、批次、PO的库位
|
||||
*
|
||||
* @param itemId 物料ID
|
||||
* @param propC1 批次号
|
||||
* @param whCode 仓库编码
|
||||
* @return List<Point>
|
||||
*/
|
||||
List<Point> findPointsWithSkuBatchPo(@Param("itemId") Long itemId, @Param("propC1") String propC1, @Param("whCode") String whCode,@Param("areaCode") String areaCode);
|
||||
|
||||
// 查询同一巷道占用数量
|
||||
@Select("SELECT COUNT(id) FROM base_point WHERE col_num = #{colNum} AND layer_num = #{layerNum} AND status = 1")
|
||||
int countOccupiedInSameColumn(@Param("colNum") String colNum, @Param("layerNum") String layerNum);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,4 +16,24 @@
|
|||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="findPointsWithSkuBatchPo" resultType="org.cpte.modules.base.entity.Point">
|
||||
SELECT DISTINCT bp1.* FROM base_point bp1
|
||||
JOIN base_area ba ON bp1.area_id = ba.id
|
||||
JOIN base_point bp2 ON bp1.col_num = bp2.col_num
|
||||
JOIN data_inventory inv ON bp2.id = inv.point_id
|
||||
<where>
|
||||
AND inv.item_id = #{itemId}
|
||||
<if test="propC1 != null and propC1 != ''">
|
||||
AND inv.prop_c1 = #{propC1}
|
||||
</if>
|
||||
<if test="whCode != null and whCode != ''">
|
||||
AND inv.wh_code = #{whCode}
|
||||
</if>
|
||||
<if test="areaCode != null and areaCode != ''">
|
||||
AND ba.area_code = #{areaCode}
|
||||
</if>
|
||||
AND bp1.status = 0
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package org.cpte.modules.base.service;
|
||||
|
||||
import org.cpte.modules.agvTask.entity.AgvTask;
|
||||
import org.cpte.modules.base.entity.Point;
|
||||
import org.cpte.modules.base.entity.Stock;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
|
|
|||
|
|
@ -82,8 +82,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
|
|||
//查询容器
|
||||
LambdaQueryWrapper<Stock> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(Stock::getStockCode, stockCodes);
|
||||
queryWrapper.eq(Stock::getDelFlag, 0);
|
||||
queryWrapper.eq(Stock::getIzActive, 1);
|
||||
return stockMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,11 +60,26 @@ public interface GeneralConstant {
|
|||
*/
|
||||
String TES_POD_TASK = "atyYyn1T";
|
||||
|
||||
/**
|
||||
* AGV任务下发接口
|
||||
*/
|
||||
String HIK_POD_TASK = "atyYyn1T";
|
||||
|
||||
/**
|
||||
* TES任务取消接口
|
||||
*/
|
||||
String TES_CANCEL_TASK = "gtKsKrUQ";
|
||||
|
||||
/**
|
||||
* AGV任务取消接口
|
||||
*/
|
||||
String HIK_CANCEL_TASK = "gtKsKrUQ";
|
||||
|
||||
/**
|
||||
* 入库回传接口
|
||||
*/
|
||||
String Login= "7Q7sqpIh";
|
||||
|
||||
/**
|
||||
* 入库回传接口
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ public enum AreaTypeEnum {
|
|||
|
||||
CPCCQ("CPCCQ", "成品存储区"),
|
||||
|
||||
MJCCQ("MJCCQ", "模具存储区"),
|
||||
|
||||
RK_DOCK("RK_DOCK", "入库输送线接驳口"),
|
||||
|
||||
CK_DOCK("CK_DOCK", "出库输送线接驳口"),
|
||||
|
|
|
|||
|
|
@ -10,4 +10,9 @@ public class ScanTrayRequest {
|
|||
@NotBlank(message = "托盘码不能为空")
|
||||
@JsonProperty("stockCode")
|
||||
private String stockCode;
|
||||
|
||||
//工作站
|
||||
@NotBlank(message = "工作站不能为空")
|
||||
@JsonProperty("station")
|
||||
private String station;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
package org.cpte.modules.conveyorLine.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.cpte.modules.agvTask.entity.AgvTask;
|
||||
import org.cpte.modules.agvTask.mapper.AgvTaskMapper;
|
||||
import org.cpte.modules.agvTask.service.IAgvTaskService;
|
||||
|
|
@ -14,16 +17,22 @@ import org.cpte.modules.base.service.IPointService;
|
|||
import org.cpte.modules.constant.enums.*;
|
||||
import org.cpte.modules.conveyorLine.request.ScanTrayRequest;
|
||||
import org.cpte.modules.conveyorLine.service.IConveyorLineService;
|
||||
import org.cpte.modules.conveyorLine.vo.PointScore;
|
||||
import org.cpte.modules.inventory.entity.Inventory;
|
||||
import org.cpte.modules.inventory.mapper.InventoryMapper;
|
||||
import org.cpte.modules.receive.entity.Asn;
|
||||
import org.cpte.modules.receive.entity.AsnDetail;
|
||||
import org.cpte.modules.receive.mapper.AsnDetailMapper;
|
||||
import org.cpte.modules.receive.mapper.AsnMapper;
|
||||
import org.cpte.modules.shipping.entity.Task;
|
||||
import org.cpte.modules.shipping.mapper.TaskMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
|
|
@ -35,6 +44,9 @@ public class IConveyorLineServiceImpl implements IConveyorLineService {
|
|||
@Autowired
|
||||
private StockMapper stockMapper;
|
||||
|
||||
@Autowired
|
||||
private AsnMapper asnMapper;
|
||||
|
||||
@Autowired
|
||||
private AsnDetailMapper asnDetailMapper;
|
||||
|
||||
|
|
@ -56,6 +68,8 @@ public class IConveyorLineServiceImpl implements IConveyorLineService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void scanTray(ScanTrayRequest scanTrayRequest) {
|
||||
//工作站
|
||||
Point srcPoint = pointMapper.queryByPointCode(scanTrayRequest.getStation());
|
||||
|
||||
//容器
|
||||
Stock stock = stockMapper.queryByStockCode(scanTrayRequest.getStockCode());
|
||||
|
|
@ -65,7 +79,7 @@ public class IConveyorLineServiceImpl implements IConveyorLineService {
|
|||
if (asnDetail == null) {
|
||||
throw new RuntimeException("【" + scanTrayRequest.getStockCode() + "】托盘,无入库信息");
|
||||
}
|
||||
|
||||
Asn asn = asnMapper.selectById(asnDetail.getAsnId());
|
||||
//验证托盘是否有库存
|
||||
if (inventoryMapper.queryByStockId(stock.getId()) != null) {
|
||||
throw new RuntimeException("【" + scanTrayRequest.getStockCode() + "】托盘已入库");
|
||||
|
|
@ -76,17 +90,205 @@ public class IConveyorLineServiceImpl implements IConveyorLineService {
|
|||
throw new RuntimeException("【" + scanTrayRequest.getStockCode() + "】托盘已扫描,请勿重复扫描");
|
||||
}
|
||||
|
||||
//输送线的起点
|
||||
Point srcPoint = pointMapper.selectById(asnDetail.getToPointId());
|
||||
|
||||
//通过算法获取目标点位
|
||||
Point dstPoint = pointService.queryToPoint(null, CommonStatusEnum.FREE.getValue(), AreaTypeEnum.CPCCQ.getValue());
|
||||
Point dstPoint = allocatePoint(asn, asnDetail, srcPoint);
|
||||
|
||||
//锁定目标库位
|
||||
pointService.bindPoint(dstPoint);
|
||||
|
||||
//验证通过,生成Tes任务
|
||||
iAgvTaskService.createAgvTask(asnDetail.getId(), stock.getStockCode(), srcPoint.getPointCode(), dstPoint.getPointCode(), null, BusinessTypeEnum.INBOUND.getValue(), AgvVendorEnum.TES.getValue());
|
||||
iAgvTaskService.createAgvTask(asnDetail.getId(), stock.getStockCode(), srcPoint.getPointCode(), dstPoint.getPointCode(), null, BusinessTypeEnum.INBOUND.getValue(), 0, AgvVendorEnum.TES.getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* 智能库位分配库位
|
||||
*
|
||||
* @param asnDetail 入库明细
|
||||
* @return 目标库位
|
||||
*/
|
||||
private Point allocatePoint(Asn asn, AsnDetail asnDetail, Point station) {
|
||||
String areaCode = "";
|
||||
if (Set.of(0, 1, 2, 3).contains(asn.getOrderType())) {
|
||||
areaCode = AreaTypeEnum.CPCCQ.getValue();
|
||||
} else {
|
||||
areaCode = AreaTypeEnum.MJCCQ.getValue();
|
||||
}
|
||||
|
||||
//1.优先寻找同物料/同批次/同PO聚集库位
|
||||
List<Point> availablePoints = findClusterPoint(asn, asnDetail, areaCode);
|
||||
if (CollectionUtils.isEmpty(availablePoints)) {
|
||||
//2.获取所有可用库位
|
||||
availablePoints = pointMapper.queryPoints(null, CommonStatusEnum.FREE.getValue(), areaCode);
|
||||
}
|
||||
|
||||
List<PointScore> scoredPoints = availablePoints.stream()
|
||||
.map(point -> calculateEnhancedLocationScore(point, station, asn, asnDetail))
|
||||
.sorted(Comparator.comparing(PointScore::getScore).reversed())
|
||||
.toList();
|
||||
|
||||
if (!scoredPoints.isEmpty()) {
|
||||
return scoredPoints.get(0).getPoint();
|
||||
}
|
||||
|
||||
throw new RuntimeException("系统无可用库位");
|
||||
}
|
||||
|
||||
/**
|
||||
* 寻找物料聚集库位
|
||||
*
|
||||
*/
|
||||
private List<Point> findClusterPoint(Asn asn, AsnDetail asnDetail, String areaCode) {
|
||||
return pointMapper.findPointsWithSkuBatchPo(asnDetail.getItemId(), asnDetail.getPropC1(), asn.getWhCode(), areaCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增强版库位评分计算
|
||||
* 新增:通道类型深度策略 + 物料聚集加分
|
||||
*/
|
||||
private PointScore calculateEnhancedLocationScore(Point point, Point station, Asn asn, AsnDetail asnDetail) {
|
||||
double totalScore = 0.0;
|
||||
|
||||
// 1. 距离评分 - 考虑从入库口到库位的距离
|
||||
double distanceScore = calculateClusterDistanceCost(point, station);
|
||||
totalScore += distanceScore * 0.3; // 权重从40%降到30%
|
||||
log.info("【{}】距离评分: {}", point.getPointCode(), totalScore);
|
||||
|
||||
// 2. 通道深度策略评分 - 新增核心策略
|
||||
double channelDepthScore = calculateChannelDepthScore(point);
|
||||
totalScore += channelDepthScore * 0.25; // 新增25%权重
|
||||
log.info("【{}】通道深度评分: {}", point.getPointCode(), totalScore);
|
||||
|
||||
// 3. 通道类型评分 - 双通道优先
|
||||
double channelScore = calculateChannelScore(point);
|
||||
totalScore += channelScore * 0.15; // 权重从20%降到15%
|
||||
log.info("【{}】通道类型评分: {}", point.getPointCode(), totalScore);
|
||||
|
||||
// 4. 均衡评分 - 避免热点区域
|
||||
double balanceScore = calculateBalanceScore(point);
|
||||
totalScore += balanceScore * 0.1; // 权重从15%降到10%
|
||||
log.info("【{}】均衡评分: {}", point.getPointCode(), totalScore);
|
||||
|
||||
// 5. 物料聚集潜力评分 - 新增
|
||||
double clusterPotentialScore = calculateClusterPotentialScore(point, asn, asnDetail);
|
||||
totalScore += clusterPotentialScore * 0.2; // 新增20%权重
|
||||
log.info("【{}】物料聚集潜力评分: {}", point.getPointCode(), totalScore);
|
||||
|
||||
return new PointScore(point, totalScore);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通道深度策略评分 - 核心优化
|
||||
* 双通道:中间优先(04),向两端扩展
|
||||
* 单通道:深度优先(07),向前扩展
|
||||
*/
|
||||
private double calculateChannelDepthScore(Point point) {
|
||||
if (point.getIzDoubleLane().equals(1)) {
|
||||
// 双通道策略:中间优先,得分 04 > 03=05 > 02=06 > 01=07
|
||||
return doubleChannelDepthScore(Integer.parseInt(point.getRowNum()));
|
||||
} else {
|
||||
// 单通道策略:深度优先,得分 07 > 06 > 05 > 04 > 03 > 02 > 01
|
||||
return singleChannelDepthScore(Integer.parseInt(point.getRowNum()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 双通道深度评分
|
||||
* 理想顺序:04 > 03=05 > 02=06 > 01=07
|
||||
*/
|
||||
private double doubleChannelDepthScore(int depth) {
|
||||
return switch (depth) {
|
||||
case 4 -> 100; // 最优位置
|
||||
case 3, 5 -> 85; // 次优位置
|
||||
case 2, 6 -> 70; // 良好位置
|
||||
case 1, 7 -> 60; // 一般位置
|
||||
default -> 50;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 单通道深度评分
|
||||
* 理想顺序:07 > 06 > 05 > 04 > 03 > 02 > 01
|
||||
*/
|
||||
private double singleChannelDepthScore(int depth) {
|
||||
// 深度越大分数越高,07得100分,01得14分
|
||||
return depth * 100.0 / 7;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算通道评分
|
||||
* 双通道库位得分高,单通道得分低
|
||||
*/
|
||||
private double calculateChannelScore(Point point) {
|
||||
return point.getIzDoubleLane().equals(1) ? 100 : 60;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算均衡评分
|
||||
* 避免同一区域过于集中,考虑周围库位占用情况
|
||||
*/
|
||||
private double calculateBalanceScore(Point point) {
|
||||
// 查询同一巷道相邻库位的占用情况
|
||||
int sameColumnOccupied = pointMapper.countOccupiedInSameColumn(point.getColNum(), point.getLayerNum());
|
||||
|
||||
// 占用率越低,分数越高
|
||||
double occupancyRate = sameColumnOccupied / 7.0; // 7个深度位置
|
||||
return (1 - occupancyRate) * 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算物料聚集潜力评分
|
||||
* 检查周围库位是否有相同特征的货物
|
||||
*/
|
||||
private double calculateClusterPotentialScore(Point point, Asn asn, AsnDetail asnDetail) {
|
||||
double score = 0.0;
|
||||
|
||||
// 检查同一巷道相邻库位
|
||||
int minDepth, maxDepth;
|
||||
if (point.getIzDoubleLane().equals(1)) {
|
||||
// 双通道:考虑整个巷道所有位置(1-7)
|
||||
// 因为双通道可以从两端操作,所有位置都算邻居
|
||||
minDepth = 1;
|
||||
maxDepth = 7;
|
||||
} else {
|
||||
// 单通道:只考虑同一侧的位置(从当前深度向前)
|
||||
// 因为只能从一端操作,后面的位置不算邻居
|
||||
minDepth = Integer.parseInt(point.getRowNum()); // 从当前位置开始
|
||||
maxDepth = 7; // 到最深位置
|
||||
}
|
||||
List<Inventory> neighbors = inventoryMapper.findNeighborPoints(point.getColNum(), point.getLayerNum(), String.valueOf(minDepth), String.valueOf(maxDepth));
|
||||
|
||||
|
||||
for (Inventory neighbor : neighbors) {
|
||||
if (neighbor.getItemId() != null) {
|
||||
// 同SKU加分
|
||||
if (neighbor.getItemId().equals(asnDetail.getItemId())) {
|
||||
score += 15;
|
||||
// 同批次额外加分
|
||||
if (asnDetail.getPropC1() != null && asnDetail.getPropC1().equals(neighbor.getPropC1())) {
|
||||
score += 10;
|
||||
// 同PO额外加分
|
||||
if (asn.getWhCode() != null && asn.getWhCode().equals(neighbor.getWhCode())) {
|
||||
score += 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 限制最高分
|
||||
return Math.min(score, 100);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算距离评分
|
||||
* 基于入库口位置和库位坐标计算最短路径距离
|
||||
*/
|
||||
private double calculateClusterDistanceCost(Point point, Point station) {
|
||||
// 计算曼哈顿距离
|
||||
double distance = Math.abs(point.getPositionX() - station.getPositionX()) + Math.abs(point.getPositionY() - station.getPositionY());
|
||||
|
||||
// 距离越小分数越高
|
||||
return Math.max(0, 100 - (distance / 100.0));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -111,7 +313,7 @@ public class IConveyorLineServiceImpl implements IConveyorLineService {
|
|||
String stockCode = tasks.get(0).getStockCode();
|
||||
String taskType = BusinessTypeEnum.getDescByValue(agvTask.getType());
|
||||
String endCode = agvTask.getEndCode();
|
||||
String izAll = agvTask.getIzAll()==1 ? "拆托" : "整托";
|
||||
String izAll = agvTask.getIzAll() == 1 ? "拆托" : "整托";
|
||||
String description = izAll.equals("拆托")
|
||||
? "请人工将托盘【" + stockCode + "】叉走,避免任务拥堵"
|
||||
: "请等待AGV将托盘【" + stockCode + "】叉走";
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
package org.cpte.modules.conveyorLine.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import org.cpte.modules.base.entity.Point;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class PointScore {
|
||||
// 库位
|
||||
private Point point;
|
||||
// 分数
|
||||
private double score;
|
||||
}
|
||||
|
|
@ -4,9 +4,13 @@ import com.alibaba.fastjson.JSON;
|
|||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.cpte.modules.agvTask.entity.AgvTask;
|
||||
import org.cpte.modules.constant.GeneralConstant;
|
||||
import org.cpte.modules.hikAgv.request.CancelRequest;
|
||||
import org.cpte.modules.hikAgv.request.SubmitRequest;
|
||||
import org.cpte.modules.hikAgv.request.TaskReporterRequest;
|
||||
import org.cpte.modules.hikAgv.service.IHikAgvService;
|
||||
import org.cpte.modules.tesAgv.response.TesResult;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.cpte.modules.hikAgv.response.HikResult;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
|
|
@ -31,21 +35,28 @@ public class HikAgvController {
|
|||
*
|
||||
* @param submitRequest 请求参数
|
||||
*/
|
||||
@AutoLog(value = "海康AGV-任务下发")
|
||||
@Operation(summary = "海康AGV-任务下发")
|
||||
@AutoLog(value = "AGV-任务下发")
|
||||
@Operation(summary = "AGV-任务下发")
|
||||
@PostMapping(value = "/controller/task/submit")
|
||||
@IgnoreAuth
|
||||
public Result<String> submit(@RequestBody SubmitRequest submitRequest) {
|
||||
iHikAgvService.sendHikAgvTask(
|
||||
"http://localhost:8000/cpte-wms/rcs/rtas/api/robot/controller/task/submit",
|
||||
JSON.toJSONString(submitRequest),
|
||||
null
|
||||
);
|
||||
return Result.OK("下发成功!");
|
||||
public HikResult submit(@RequestBody SubmitRequest submitRequest) {
|
||||
try {
|
||||
iHikAgvService.sendHikAgvTask(
|
||||
GeneralConstant.HIK_POD_TASK,
|
||||
JSON.toJSONString(submitRequest),
|
||||
null
|
||||
);
|
||||
HikResult.ResponesData data = new HikResult.ResponesData();
|
||||
data.setRobotTaskCode(submitRequest.getRobotTaskCode());
|
||||
return HikResult.success(data);
|
||||
} catch (Exception e) {
|
||||
return HikResult.error(e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@AutoLog(value = "海康AGV-任务上报")
|
||||
@Operation(summary = "海康AGV-任务上报")
|
||||
@AutoLog(value = "AGV-任务上报")
|
||||
@Operation(summary = "AGV-任务上报")
|
||||
@PostMapping(value = "/reporter/task")
|
||||
public HikResult taskReporter(@RequestBody TaskReporterRequest taskReporterRequest) {
|
||||
try {
|
||||
|
|
@ -57,4 +68,32 @@ public class HikAgvController {
|
|||
return HikResult.error("系统异常: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@AutoLog(value = "AGV-任务取消")
|
||||
@Operation(summary = "AGV-任务取消")
|
||||
@PostMapping(value = "/cancelAgv")
|
||||
public HikResult cancelAgv(@RequestBody CancelRequest cancelRequest) {
|
||||
try {
|
||||
iHikAgvService.cancelAgv(cancelRequest);
|
||||
HikResult.ResponesData data = new HikResult.ResponesData();
|
||||
data.setRobotTaskCode(cancelRequest.getRobotTaskCode());
|
||||
return HikResult.success(data);
|
||||
} catch (Exception e) {
|
||||
return HikResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@AutoLog(value = "AGV-重送任务")
|
||||
@Operation(summary = "AGV-重送任务")
|
||||
@PostMapping(value = "/resendAgv")
|
||||
public HikResult resendAgv(@RequestBody AgvTask agvTask) {
|
||||
try {
|
||||
iHikAgvService.resendAgv(agvTask);
|
||||
HikResult.ResponesData data = new HikResult.ResponesData();
|
||||
data.setRobotTaskCode(agvTask.getId().toString());
|
||||
return HikResult.success(data);
|
||||
} catch (Exception e) {
|
||||
return HikResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,78 @@
|
|||
package org.cpte.modules.hikAgv.request;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class CancelRequest {
|
||||
/**
|
||||
* 任务号,全局唯一
|
||||
*/
|
||||
@JsonProperty("robotTaskCode")
|
||||
private String robotTaskCode;
|
||||
|
||||
/**
|
||||
* 取消任务类型
|
||||
*/
|
||||
@JsonProperty("cancelType")
|
||||
private String cancelType;
|
||||
|
||||
/**
|
||||
* 载具编号
|
||||
*/
|
||||
@JsonProperty("carrierCode")
|
||||
private String carrierCode;
|
||||
|
||||
/**
|
||||
* 取消原因
|
||||
*/
|
||||
@JsonProperty("reason")
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 软取消的回库任务类型。
|
||||
*/
|
||||
@JsonProperty("returnTaskType")
|
||||
private String returnTaskType;
|
||||
|
||||
|
||||
@JsonProperty("targetRoute")
|
||||
private List<TargetRoute> targetRoute;
|
||||
|
||||
|
||||
@Data
|
||||
public static class TargetRoute {
|
||||
|
||||
/**
|
||||
* 预制类型
|
||||
*/
|
||||
@JsonProperty("type")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* type 对应的目标编号
|
||||
*/
|
||||
@JsonProperty("code")
|
||||
private String code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义扩展字段
|
||||
*/
|
||||
@JsonProperty("extra")
|
||||
private Extra extra;
|
||||
|
||||
@Data
|
||||
public static class Extra {
|
||||
|
||||
/**
|
||||
* 软取消生成回库任务的任务链编号
|
||||
*/
|
||||
@JsonProperty("taskCode")
|
||||
private String taskCode;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package org.cpte.modules.hikAgv.service;
|
||||
|
||||
import org.cpte.modules.agvTask.entity.AgvTask;
|
||||
import org.cpte.modules.hikAgv.request.CancelRequest;
|
||||
import org.cpte.modules.hikAgv.request.SubmitRequest;
|
||||
import org.cpte.modules.hikAgv.request.TaskReporterRequest;
|
||||
|
||||
|
|
@ -15,11 +16,11 @@ public interface IHikAgvService {
|
|||
/**
|
||||
* 下发任务
|
||||
*
|
||||
* @param url 接口地址
|
||||
* @param openApi 接口地址
|
||||
* @param json 接口json
|
||||
* @param agvTask 任务
|
||||
*/
|
||||
void sendHikAgvTask(String url, String json, AgvTask agvTask);
|
||||
void sendHikAgvTask(String openApi, String json, AgvTask agvTask);
|
||||
|
||||
/**
|
||||
* 任务上报
|
||||
|
|
@ -27,4 +28,18 @@ public interface IHikAgvService {
|
|||
* @param taskReporterRequest 任务上报参数
|
||||
*/
|
||||
void taskReporter(TaskReporterRequest taskReporterRequest);
|
||||
|
||||
/**
|
||||
* 任务取消
|
||||
*
|
||||
* @param cancelRequest 任务取消参数
|
||||
*/
|
||||
void cancelAgv(CancelRequest cancelRequest);
|
||||
|
||||
/**
|
||||
* 重新发送任务
|
||||
*
|
||||
* @param agvTask 待发送任务
|
||||
*/
|
||||
void resendAgv(AgvTask agvTask);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,11 @@ import org.cpte.modules.base.service.IPointService;
|
|||
import org.cpte.modules.base.service.IStockService;
|
||||
import org.cpte.modules.constant.GeneralConstant;
|
||||
import org.cpte.modules.constant.enums.*;
|
||||
import org.cpte.modules.hikAgv.request.CancelRequest;
|
||||
import org.cpte.modules.hikAgv.request.SubmitRequest;
|
||||
import org.cpte.modules.hikAgv.request.TaskReporterRequest;
|
||||
import org.cpte.modules.hikAgv.service.IHikAgvService;
|
||||
import org.jeecg.modules.openapi.mapper.OpenApiMapper;
|
||||
import org.jeecg.modules.system.mapper.SysDictMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -36,6 +38,9 @@ public class IHikAgvServiceImpl implements IHikAgvService {
|
|||
@Autowired
|
||||
private AgvTaskMapper agvTaskMapper;
|
||||
|
||||
@Autowired
|
||||
private OpenApiMapper openApiMapper;
|
||||
|
||||
@Autowired
|
||||
private IStockService iStockService;
|
||||
|
||||
|
|
@ -78,13 +83,14 @@ public class IHikAgvServiceImpl implements IHikAgvService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void sendHikAgvTask(String url, String json, AgvTask agvTask) {
|
||||
public void sendHikAgvTask(String openApi, String json, AgvTask agvTask) {
|
||||
log.info("请求报文:{}", json);
|
||||
// 检查接口开关, 未开启则返回
|
||||
if (sysDictMapper.queryByDictCode(GeneralConstant.OPEN_FLAG) == null) {
|
||||
updateAgvTaskResponse(agvTask, "接口未开启", GeneralConstant.AGV_FAIL_CODE);
|
||||
return;
|
||||
}
|
||||
String url = openApiMapper.getRequestUrl(openApi);
|
||||
|
||||
String code = null;
|
||||
String message = null;
|
||||
|
|
@ -142,13 +148,66 @@ public class IHikAgvServiceImpl implements IHikAgvService {
|
|||
//任务完成
|
||||
handleEnd(agvTask, stock, point);
|
||||
break;
|
||||
case "resend":
|
||||
//重新发送
|
||||
handleResend(agvTask);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private String generateCancelTaskJson(AgvTask agvTask) {
|
||||
CancelRequest cancelRequest = new CancelRequest();
|
||||
cancelRequest.setRobotTaskCode(agvTask.getId().toString());
|
||||
cancelRequest.setCancelType("CANCEL");
|
||||
cancelRequest.setReason("取消");
|
||||
return JSON.toJSONString(cancelRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelAgv(CancelRequest cancelRequest) {
|
||||
AgvTask agvTask = agvTaskMapper.selectById(cancelRequest.getRobotTaskCode());
|
||||
String url = openApiMapper.getRequestUrl(GeneralConstant.HIK_CANCEL_TASK);
|
||||
String json = generateCancelTaskJson(agvTask);
|
||||
String code = null;
|
||||
String message = null;
|
||||
//String result = HttpPostUtil.sendPostReq(url, json);
|
||||
String result = "{\n" +
|
||||
" \"message\": \"成功\",\n" +
|
||||
" \"code\":\"SUCCESS\",\n" +
|
||||
"}";
|
||||
if (StringUtils.isEmpty(result)) {
|
||||
message = "AGV返回信息:任务取消接口调用失败";
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
|
||||
JSONObject resulObject = JSON.parseObject(result);
|
||||
if (resulObject == null) {
|
||||
message = "AGV返回信息:任务取消接口返回为空";
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
|
||||
code = resulObject.getString("code");
|
||||
message = resulObject.getString("message");
|
||||
|
||||
if (!GeneralConstant.AGV_SUCCESS_CODE.equals(code)) {
|
||||
throw new RuntimeException("AGV返回消息:" + message);
|
||||
}
|
||||
|
||||
handleCelled(agvTask);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resendAgv(AgvTask agvTask) {
|
||||
handleResend(agvTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务取消
|
||||
*
|
||||
* @param agvTask 任务
|
||||
*/
|
||||
private void handleCelled(AgvTask agvTask) {
|
||||
agvTask.setStatus(AgvStatusEnum.CANCELLED.getValue());
|
||||
agvTask.setEndTime(new Date());
|
||||
agvTaskMapper.updateById(agvTask);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 走出储位
|
||||
|
|
@ -185,12 +244,12 @@ public class IHikAgvServiceImpl implements IHikAgvService {
|
|||
if (count > 0) {
|
||||
throw new RuntimeException("任务已重新生成,请勿重复操作! ");
|
||||
}
|
||||
AgvTask newAgvTask = iAgvTaskService.createAgvTask(agvTask.getBusinessDetailId(), agvTask.getCarrierCode(), agvTask.getStartCode(), agvTask.getEndCode(), null, agvTask.getType(), AgvVendorEnum.HIK.getValue());
|
||||
AgvTask newAgvTask = iAgvTaskService.createAgvTask(agvTask.getBusinessDetailId(), agvTask.getCarrierCode(), agvTask.getStartCode(), agvTask.getEndCode(), null, agvTask.getType(),agvTask.getIzAll(), AgvVendorEnum.HIK.getValue());
|
||||
switch (agvTask.getType()) {
|
||||
case "INBOUND":
|
||||
case "OUTBOUND":
|
||||
//下发海康AGV任务
|
||||
sendHikAgvTask("", "", newAgvTask);
|
||||
sendHikAgvTask(GeneralConstant.HIK_POD_TASK, generateHikAgvTaskJson(newAgvTask), newAgvTask);
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("任务类型不支持: " + agvTask.getType());
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.cpte.modules.inventory.mapper;
|
|||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.cpte.modules.base.entity.Point;
|
||||
import org.cpte.modules.inventory.entity.Inventory;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
|
|
@ -36,4 +37,19 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
|
|||
*/
|
||||
List<Inventory> queryInventoryWithLock(@Param("itemIds") List<Long> itemIds, @Param("propC1List") List<String> propC1List, @Param("propC3List") List<String> propC3List, @Param("whCodeList") List<String> whCodeList);
|
||||
|
||||
// 查询相邻库位(同一巷道,深度±3范围内)
|
||||
@Select("SELECT di.* " +
|
||||
"FROM data_inventory di " +
|
||||
"JOIN base_point bp ON di.point_id = bp.id " +
|
||||
"WHERE bp.col_num = #{colNum} " +
|
||||
" AND bp.layer_num = #{layerNum} " +
|
||||
" AND bp.row_num BETWEEN #{minDepth} AND #{maxDepth} " +
|
||||
" AND bp.status = 1")
|
||||
List<Inventory> findNeighborPoints(@Param("colNum") String colNum,
|
||||
@Param("layerNum") String layerNum,
|
||||
@Param("minDepth") String minDepth,
|
||||
@Param("maxDepth") String maxDepth);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.cpte.modules.receive.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -13,7 +14,6 @@ import org.cpte.modules.base.service.IPointService;
|
|||
import org.cpte.modules.base.service.IStockService;
|
||||
import org.cpte.modules.constant.GeneralConstant;
|
||||
import org.cpte.modules.constant.enums.AsnStatusEnum;
|
||||
import org.cpte.modules.constant.enums.CommonStatusEnum;
|
||||
import org.cpte.modules.inventory.entity.Inventory;
|
||||
import org.cpte.modules.inventory.mapper.InventoryMapper;
|
||||
import org.cpte.modules.inventory.service.IInventoryService;
|
||||
|
|
@ -25,10 +25,10 @@ import org.cpte.modules.receive.mapper.AsnDetailMapper;
|
|||
import org.cpte.modules.receive.mapper.AsnMapper;
|
||||
import org.cpte.modules.receive.mapper.ReceiveRecordMapper;
|
||||
import org.cpte.modules.receive.service.IAsnService;
|
||||
import org.cpte.modules.saiWms.request.SaiWmsRequest;
|
||||
import org.cpte.modules.utils.BigDecimalUtil;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.cpte.modules.utils.SwmsLoginUtil;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.openapi.mapper.OpenApiMapper;
|
||||
import org.jeecg.modules.system.mapper.SysDictMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -78,6 +78,8 @@ public class AsnServiceImpl extends ServiceImpl<AsnMapper, Asn> implements IAsnS
|
|||
private IInventoryService iInventoryService;
|
||||
@Autowired
|
||||
private IInventoryLogService iInventoryLogService;
|
||||
@Autowired
|
||||
private SwmsLoginUtil swmsLoginUtil;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
|
@ -263,18 +265,37 @@ public class AsnServiceImpl extends ServiceImpl<AsnMapper, Asn> implements IAsnS
|
|||
* 入库任务回传JSON
|
||||
*/
|
||||
private String receiveCallbackJson(Asn asn, AsnDetail asnDetail, Stock stock) {
|
||||
JSONObject jsonObject = new JSONObject(true);
|
||||
jsonObject.put("No", asn.getNo());
|
||||
jsonObject.put("OrderNo", asn.getThirdOrderNo());
|
||||
jsonObject.put("State", 5);
|
||||
jsonObject.put("LineNo", asnDetail.getLineNo());
|
||||
jsonObject.put("Lpn", stock.getStockCode());
|
||||
jsonObject.put("Qty", asnDetail.getOrderQty());
|
||||
jsonObject.put("Project", asnDetail.getProject());
|
||||
jsonObject.put("TaskNo", asnDetail.getTaskNo());
|
||||
jsonObject.put("LotAtt04", asnDetail.getPropC1());
|
||||
jsonObject.put("LotAtt010", asnDetail.getPropC3());
|
||||
return jsonObject.toJSONString();
|
||||
|
||||
SaiWmsRequest.Task task = new SaiWmsRequest.Task();
|
||||
task.setNo(asn.getNo());
|
||||
task.setOrderNo(asn.getThirdOrderNo());
|
||||
task.setState(5);
|
||||
task.setLpn(stock.getStockCode());
|
||||
task.setErpKey("");
|
||||
task.setCode("");
|
||||
task.setName("");
|
||||
task.setInfkey("");
|
||||
task.setIsDelete(false);
|
||||
task.setLastUpdateDate("");
|
||||
|
||||
|
||||
SaiWmsRequest.ParameterValue1 parameterValue1 = new SaiWmsRequest.ParameterValue1();
|
||||
parameterValue1.setValue(List.of(task));
|
||||
|
||||
SaiWmsRequest.ParameterValue2 parameterValue2 = new SaiWmsRequest.ParameterValue2();
|
||||
parameterValue2.setValue(1);
|
||||
|
||||
SaiWmsRequest.Context context = new SaiWmsRequest.Context();
|
||||
context.setInvOrgId(1);
|
||||
context.setTicket(swmsLoginUtil.Login());
|
||||
|
||||
SaiWmsRequest saiWmsRequest = new SaiWmsRequest();
|
||||
saiWmsRequest.setApiType("SmomWebApiController");
|
||||
saiWmsRequest.setParameters(List.of(parameterValue1, parameterValue2));
|
||||
saiWmsRequest.setMethod("AutomatedWarehouseTasks");
|
||||
saiWmsRequest.setContext(context);
|
||||
|
||||
return JSON.toJSONString(saiWmsRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -285,15 +306,13 @@ public class AsnServiceImpl extends ServiceImpl<AsnMapper, Asn> implements IAsnS
|
|||
updateAsnDetailResponse(asn, "接口未开启");
|
||||
return;
|
||||
}
|
||||
/* if(AsnStatusEnum.){
|
||||
|
||||
}*/
|
||||
String json = receiveCallbackJson(asn, asnDetail, stock);
|
||||
String url = openApiMapper.getRequestUrl(GeneralConstant.INBOUND_CALLBACK);
|
||||
log.info("入库回传请求报文:{}", json);
|
||||
Boolean Success = null;
|
||||
String Message = null;
|
||||
try {
|
||||
String json = receiveCallbackJson(asn, asnDetail, stock);
|
||||
String url = openApiMapper.getRequestUrl(GeneralConstant.INBOUND_CALLBACK);
|
||||
log.info("入库回传请求报文:{}", json);
|
||||
//String result = HttpPostUtil.sendPostReq(url, json);
|
||||
String result = "{\n" +
|
||||
" \"Success\": false,\n" +
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import jakarta.validation.Valid;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.cpte.modules.saiWms.request.InboundRequest;
|
||||
import org.cpte.modules.saiWms.request.OutboundRequest;
|
||||
import org.cpte.modules.saiWms.request.SyncStockRequest;
|
||||
import org.cpte.modules.saiWms.service.ISaiWmsService;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
|
|
@ -25,6 +26,19 @@ public class SaiWmsController {
|
|||
@Autowired
|
||||
private ISaiWmsService iSaiWmsService;
|
||||
|
||||
/**
|
||||
* 容器同步
|
||||
*
|
||||
* @param syncStockRequest 请求参数
|
||||
*/
|
||||
@AutoLog(value = "容器同步")
|
||||
@Operation(summary = "赛意WMS-容器同步")
|
||||
@PostMapping(value = "/syncStock")
|
||||
public Result<String> syncStock(@RequestBody SyncStockRequest syncStockRequest) {
|
||||
iSaiWmsService.syncStock(syncStockRequest);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库任务下发
|
||||
*
|
||||
|
|
@ -32,8 +46,8 @@ public class SaiWmsController {
|
|||
*/
|
||||
@AutoLog(value = "入库任务下发")
|
||||
@Operation(summary = "赛意WMS-入库任务下发")
|
||||
@PostMapping(value = "/inBound/inBoundTask")
|
||||
public Result<String> inBoundTask(@RequestBody @Valid InboundRequest inboundRequest) {
|
||||
@PostMapping(value = "/inBoundTask")
|
||||
public Result<String> inBoundTask(@RequestBody InboundRequest inboundRequest) {
|
||||
iSaiWmsService.inBoundTask(inboundRequest);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
|
@ -45,7 +59,7 @@ public class SaiWmsController {
|
|||
*/
|
||||
@AutoLog(value = "出库任务下发")
|
||||
@Operation(summary = "赛意WMS-出库任务下发")
|
||||
@PostMapping(value = "/outBound/outBoundTask")
|
||||
@PostMapping(value = "/outBoundTask")
|
||||
public Result<String> outBoundTask(@RequestBody @Valid OutboundRequest outboundRequest) {
|
||||
iSaiWmsService.outBoundTask(outboundRequest);
|
||||
return Result.OK("操作成功!");
|
||||
|
|
|
|||
|
|
@ -17,17 +17,14 @@ import java.util.List;
|
|||
@Data
|
||||
public class InboundRequest {
|
||||
// 任务号
|
||||
@NotBlank(message = "任务号不能为空")
|
||||
@JsonProperty("No")
|
||||
private String no;
|
||||
|
||||
// 单号
|
||||
@NotBlank(message = "单号不能为空")
|
||||
@JsonProperty("OrderNo")
|
||||
private String orderNo;
|
||||
|
||||
// 仓库
|
||||
@NotBlank(message = "仓库不能为空")
|
||||
@JsonProperty("WhCode")
|
||||
private String whCode;
|
||||
|
||||
|
|
@ -36,45 +33,36 @@ public class InboundRequest {
|
|||
private String supplierCode;
|
||||
|
||||
// 单据类型:0.成品入库;1.配件入库;2.成品拆托入库;3.配件拆托入库;4.成品出库;5.配件出库;6.返工出库;7.检验出库;8.其他出库
|
||||
@NotNull(message = "单据类型不能为空")
|
||||
@JsonProperty("Type")
|
||||
private Integer type;
|
||||
|
||||
// 起点
|
||||
@NotBlank(message = "起点不能为空")
|
||||
@JsonProperty("LocationFrom")
|
||||
private String locationFrom;
|
||||
|
||||
// 入库明细列表
|
||||
@NotNull(message = "入库明细不能为空")
|
||||
@JsonProperty("details")
|
||||
@Valid
|
||||
private List<InboundDetail> details;
|
||||
|
||||
@Data
|
||||
public static class InboundDetail {
|
||||
// 行号
|
||||
@NotBlank(message = "行号不能为空")
|
||||
@JsonProperty("LineNo")
|
||||
private String lineNo;
|
||||
|
||||
// 物料
|
||||
@NotBlank(message = "物料不能为空")
|
||||
@JsonProperty("Item")
|
||||
private String item;
|
||||
|
||||
// 单位
|
||||
@NotBlank(message = "单位不能为空")
|
||||
@JsonProperty("Unit")
|
||||
private String unit;
|
||||
|
||||
// 数量
|
||||
@NotNull(message = "数量不能为空")
|
||||
@JsonProperty("Qty")
|
||||
private BigDecimal qty;
|
||||
private Double qty;
|
||||
|
||||
// 托盘号
|
||||
@NotNull(message = "托盘号不能为空")
|
||||
@JsonProperty("Lpn")
|
||||
private String lpn;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,86 @@
|
|||
package org.cpte.modules.saiWms.request;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SaiWmsRequest {
|
||||
@JsonProperty("ApiType")
|
||||
private String apiType;
|
||||
|
||||
@JsonProperty("Parameters")
|
||||
private List<Object> parameters;
|
||||
|
||||
@JsonProperty("Method")
|
||||
private String method;
|
||||
|
||||
@JsonProperty("Context")
|
||||
private Context context;
|
||||
|
||||
@Data
|
||||
public static class Context {
|
||||
@JsonProperty("InvOrgId")
|
||||
private Integer invOrgId;
|
||||
|
||||
@JsonProperty("Ticket")
|
||||
private String ticket;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Task {
|
||||
@JsonProperty("No")
|
||||
private String no;
|
||||
|
||||
@JsonProperty("OrderNo")
|
||||
private String orderNo;
|
||||
|
||||
@JsonProperty("State")
|
||||
private Integer state;
|
||||
|
||||
@JsonProperty("LPN")
|
||||
private String lpn;
|
||||
|
||||
@JsonProperty("ErpKey")
|
||||
private String erpKey;
|
||||
|
||||
@JsonProperty("Code")
|
||||
private String code;
|
||||
|
||||
@JsonProperty("Name")
|
||||
private String name;
|
||||
|
||||
@JsonProperty("Infkey")
|
||||
private String infkey;
|
||||
|
||||
@JsonProperty("IsDelete")
|
||||
private Boolean isDelete;
|
||||
|
||||
@JsonProperty("LastUpdateDate")
|
||||
private String lastUpdateDate;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ParameterValue1 {
|
||||
@JsonProperty("Value")
|
||||
private List<Task> value;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ParameterValue2 {
|
||||
@JsonProperty("Value")
|
||||
private Integer value;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ParameterValue3 {
|
||||
@JsonProperty("Value")
|
||||
private String value;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package org.cpte.modules.saiWms.request;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SyncStockRequest {
|
||||
@JsonProperty("stocks")
|
||||
private List<Stock> stocks;
|
||||
|
||||
@Data
|
||||
public static class Stock {
|
||||
@JsonProperty("Code")
|
||||
private String code;
|
||||
|
||||
@JsonProperty("IzActive")
|
||||
private Integer izActive;
|
||||
|
||||
@JsonProperty("DelFlag")
|
||||
private Integer delFlag;
|
||||
}
|
||||
}
|
||||
|
|
@ -2,8 +2,10 @@ package org.cpte.modules.saiWms.service;
|
|||
|
||||
import org.cpte.modules.saiWms.request.InboundRequest;
|
||||
import org.cpte.modules.saiWms.request.OutboundRequest;
|
||||
import org.cpte.modules.saiWms.request.SyncStockRequest;
|
||||
|
||||
public interface ISaiWmsService {
|
||||
|
||||
/**
|
||||
* 入库任务下发
|
||||
*
|
||||
|
|
@ -18,5 +20,8 @@ public interface ISaiWmsService {
|
|||
*/
|
||||
void outBoundTask(OutboundRequest outboundRequest);
|
||||
|
||||
|
||||
/**
|
||||
* 容器同步
|
||||
*/
|
||||
void syncStock(SyncStockRequest syncStockRequest);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package org.cpte.modules.saiWms.service.impl;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.cpte.modules.agvTask.service.IAgvTaskService;
|
||||
import org.cpte.modules.base.entity.Item;
|
||||
import org.cpte.modules.base.entity.Point;
|
||||
|
|
@ -16,6 +19,7 @@ import org.cpte.modules.receive.mapper.AsnMapper;
|
|||
import org.cpte.modules.receive.service.IAsnService;
|
||||
import org.cpte.modules.saiWms.request.InboundRequest;
|
||||
import org.cpte.modules.saiWms.request.OutboundRequest;
|
||||
import org.cpte.modules.saiWms.request.SyncStockRequest;
|
||||
import org.cpte.modules.saiWms.service.ISaiWmsService;
|
||||
import org.cpte.modules.serialNumber.AsnSerialNumberRule;
|
||||
import org.cpte.modules.serialNumber.PickSerialNumberRule;
|
||||
|
|
@ -23,12 +27,15 @@ import org.cpte.modules.shipping.entity.Pick;
|
|||
import org.cpte.modules.shipping.entity.PickDetail;
|
||||
import org.cpte.modules.shipping.mapper.PickMapper;
|
||||
import org.cpte.modules.shipping.service.IPickService;
|
||||
import org.cpte.modules.utils.BatchUtil;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
|
|
@ -64,10 +71,64 @@ public class ISaiWmsServiceImpl implements ISaiWmsService {
|
|||
@Autowired
|
||||
private PickSerialNumberRule pickSerialNumberRule;
|
||||
|
||||
@Autowired
|
||||
private BatchUtil batchUtil;
|
||||
|
||||
private void validateParams(InboundRequest inboundRequest) {
|
||||
if (StringUtils.isBlank(inboundRequest.getNo())) {
|
||||
throw new RuntimeException("任务号(No)必填");
|
||||
}
|
||||
if (StringUtils.isBlank(inboundRequest.getOrderNo())) {
|
||||
throw new RuntimeException("单号(OrderNo)必填");
|
||||
}
|
||||
if (StringUtils.isBlank(inboundRequest.getWhCode())) {
|
||||
throw new RuntimeException("仓库(WhCode)必填");
|
||||
}
|
||||
if (inboundRequest.getType() == null) {
|
||||
throw new RuntimeException("任务类型(Type)必填");
|
||||
}
|
||||
if (inboundRequest.getType().equals(0)) {
|
||||
if (StringUtils.isBlank(inboundRequest.getLocationFrom())) {
|
||||
throw new RuntimeException("成品入库,起点(LocationFrom)必填");
|
||||
}
|
||||
}
|
||||
|
||||
if (CollectionUtils.isEmpty(inboundRequest.getDetails())) {
|
||||
throw new RuntimeException("入库信息不能为空");
|
||||
}
|
||||
|
||||
// 校验每个detail项
|
||||
for (InboundRequest.InboundDetail detail : inboundRequest.getDetails()) {
|
||||
|
||||
if (StringUtils.isBlank(detail.getLineNo())) {
|
||||
throw new RuntimeException("行号(LineNo)必填");
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(detail.getItem())) {
|
||||
throw new RuntimeException("物料(Item)必填");
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(detail.getUnit())) {
|
||||
throw new RuntimeException("单位(Unit)必填");
|
||||
}
|
||||
|
||||
if (detail.getQty() <= 0) {
|
||||
throw new RuntimeException("数量(Qty)必须大于0");
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(detail.getLpn())) {
|
||||
throw new RuntimeException("托盘号(Lpn)必填");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void inBoundTask(InboundRequest inboundRequest) {
|
||||
//验证参数
|
||||
validateParams(inboundRequest);
|
||||
|
||||
//验证任务号
|
||||
String no = inboundRequest.getNo();
|
||||
Asn asn = asnMapper.queryByNo(no);
|
||||
|
|
@ -75,8 +136,6 @@ public class ISaiWmsServiceImpl implements ISaiWmsService {
|
|||
throw new RuntimeException("【" + no + "】任务号已接收,请勿重复下发");
|
||||
}
|
||||
|
||||
//一个托盘一个任务,不允许一个多盘多个任务
|
||||
|
||||
// 获取唯一的明细
|
||||
InboundRequest.InboundDetail detail = inboundRequest.getDetails().get(0);
|
||||
|
||||
|
|
@ -94,7 +153,7 @@ public class ISaiWmsServiceImpl implements ISaiWmsService {
|
|||
|
||||
// 创建入库单和明细
|
||||
Asn createAsn = buildAsn(inboundRequest);
|
||||
AsnDetail asnDetail = buildAsnDetail(detail, srcPoint,dstPoint, item, stock);
|
||||
AsnDetail asnDetail = buildAsnDetail(detail, srcPoint, dstPoint, item, stock);
|
||||
|
||||
// 保存入库单和入库明细
|
||||
asnService.saveMain(createAsn, Collections.singletonList(asnDetail));
|
||||
|
|
@ -105,7 +164,7 @@ public class ISaiWmsServiceImpl implements ISaiWmsService {
|
|||
//成品入库需要生成AGV
|
||||
if (AsnOrderTypeEnum.PRODUCT.getValue().equals(createAsn.getOrderType())) {
|
||||
//创建AGV任务
|
||||
iAgvTaskService.createAgvTask(asnDetail.getId(), stock.getStockCode(), srcPoint.getPointCode(), dstPoint.getPointCode(), null, BusinessTypeEnum.INBOUND.getValue(), AgvVendorEnum.HIK.getValue());
|
||||
iAgvTaskService.createAgvTask(asnDetail.getId(), stock.getStockCode(), srcPoint.getPointCode(), dstPoint.getPointCode(), null, BusinessTypeEnum.INBOUND.getValue(), 0, AgvVendorEnum.HIK.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -140,6 +199,98 @@ public class ISaiWmsServiceImpl implements ISaiWmsService {
|
|||
|
||||
}
|
||||
|
||||
//参数校验
|
||||
private void validateParams(SyncStockRequest syncStockRequest) {
|
||||
if (syncStockRequest.getStocks() == null || syncStockRequest.getStocks().isEmpty()) {
|
||||
throw new RuntimeException("托盘信息不能为空");
|
||||
}
|
||||
|
||||
// 校验每个stock项
|
||||
for (SyncStockRequest.Stock stock : syncStockRequest.getStocks()) {
|
||||
|
||||
if (StringUtils.isBlank(stock.getCode())) {
|
||||
throw new RuntimeException("容器编码(Code)不能为空");
|
||||
}
|
||||
|
||||
if (stock.getIzActive() == null) {
|
||||
throw new RuntimeException("启用状态(IzActive)不能为空");
|
||||
}
|
||||
|
||||
if (stock.getDelFlag() == null) {
|
||||
throw new RuntimeException("删除标志(DelFlag)不能为空");
|
||||
}
|
||||
|
||||
// 校验 IzActive 有效性 (假设只能是0或1)
|
||||
if (stock.getIzActive() != 0 && stock.getIzActive() != 1) {
|
||||
throw new RuntimeException("启用状态(IzActive)必须为0或1");
|
||||
}
|
||||
|
||||
// 校验 DelFlag 有效性 (假设只能是0或1)
|
||||
if (stock.getDelFlag() != 0 && stock.getDelFlag() != 1) {
|
||||
throw new RuntimeException("删除标志(DelFlag)必须为0或1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncStock(SyncStockRequest syncStockRequest) {
|
||||
|
||||
// 参数校验
|
||||
validateParams(syncStockRequest);
|
||||
|
||||
//获取所有容器
|
||||
List<String> stocks = syncStockRequest.getStocks().stream().map(SyncStockRequest.Stock::getCode).distinct().toList();
|
||||
|
||||
Map<String, Stock> stocksList = iStockService.queryByStockCodesToMap(stocks);
|
||||
|
||||
List<Stock> insertToStock = new ArrayList<>();
|
||||
List<Stock> updateToStock = new ArrayList<>();
|
||||
|
||||
for (SyncStockRequest.Stock stock : syncStockRequest.getStocks()) {
|
||||
Stock exitStock = stocksList.get(stock.getCode());
|
||||
if (exitStock == null) {
|
||||
Stock createStock = buildStocK(stock);
|
||||
insertToStock.add(createStock);
|
||||
} else {
|
||||
exitStock.setIzActive(stock.getIzActive());
|
||||
exitStock.setDelFlag(stock.getDelFlag());
|
||||
updateToStock.add(exitStock);
|
||||
}
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(insertToStock)) {
|
||||
batchUtil.saveBatchStock(insertToStock);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(updateToStock)) {
|
||||
batchUtil.batchUpdateStocks(updateToStock);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建容器
|
||||
*/
|
||||
private Stock buildStocK(SyncStockRequest.Stock stock) {
|
||||
LoginUser sysUser = null;
|
||||
try {
|
||||
sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
} catch (Exception e) {
|
||||
log.error("获取登录用户信息失败");
|
||||
}
|
||||
return Stock.builder()
|
||||
.stockCode(stock.getCode())
|
||||
.stockType(StockTypeEnum.TRAY.getValue())
|
||||
.izActive(stock.getIzActive())
|
||||
.status(CommonStatusEnum.FREE.getValue())
|
||||
.delFlag(stock.getDelFlag())
|
||||
.sysOrgCode(sysUser == null ? "A05" : sysUser.getOrgCode())
|
||||
.tenantId(sysUser == null ? 1000L : Long.parseLong(sysUser.getRelTenantIds()))
|
||||
.createBy(sysUser == null ? "saiWms" : sysUser.getUsername())
|
||||
.createTime(new Date())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建入库单
|
||||
*/
|
||||
|
|
@ -166,7 +317,7 @@ public class ISaiWmsServiceImpl implements ISaiWmsService {
|
|||
.lineNo(Integer.parseInt(detail.getLineNo()))
|
||||
.itemId(item.getId())
|
||||
.unit(detail.getUnit())
|
||||
.orderQty(detail.getQty())
|
||||
.orderQty(BigDecimal.valueOf(detail.getQty()))
|
||||
.receivedQty(BigDecimal.ZERO)
|
||||
.stockId(stock.getId())
|
||||
.fromPointId(srcPoint.getId())
|
||||
|
|
|
|||
|
|
@ -146,8 +146,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements IT
|
|||
Integer izAll = allSplit ? 1 : 0;
|
||||
log.info("任务分组:{}", key);
|
||||
if (!groupToAgvTaskMap.containsKey(key)) {
|
||||
AgvTask agvTask = agvTaskService.bulidAgvTask(null, key.getStockCode(), key.getFromPointCode(), key.getToPointCode(), null, BusinessTypeEnum.OUTBOUND.getValue(), AgvVendorEnum.TES.getValue());
|
||||
agvTask.setIzAll(izAll);
|
||||
AgvTask agvTask = agvTaskService.bulidAgvTask(null, key.getStockCode(), key.getFromPointCode(), key.getToPointCode(), null, BusinessTypeEnum.OUTBOUND.getValue(),izAll, AgvVendorEnum.TES.getValue());
|
||||
createToAgvTaskList.add(agvTask);
|
||||
groupToAgvTaskMap.put(key, agvTask); // 建立映射
|
||||
log.info("创建AGV任务:{}", agvTask);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.cpte.modules.agvTask.entity.AgvTask;
|
||||
import org.cpte.modules.constant.GeneralConstant;
|
||||
import org.cpte.modules.tesAgv.request.CancelTaskRequest;
|
||||
import org.cpte.modules.tesAgv.request.NewMovePodTaskRequest;
|
||||
import org.cpte.modules.tesAgv.request.TesCallbackRequest;
|
||||
|
|
@ -19,7 +20,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Tag(name = "TesAGV")
|
||||
@Tag(name = "TES")
|
||||
@RestController
|
||||
@RequestMapping("/tes/apiv2")
|
||||
@Slf4j
|
||||
|
|
@ -33,17 +34,13 @@ public class TesAgvController {
|
|||
*
|
||||
* @param newMovePodTaskRequest 请求参数
|
||||
*/
|
||||
@AutoLog(value = "TesAGV-任务下发")
|
||||
@Operation(summary = "TesAGV-任务下发")
|
||||
@AutoLog(value = "TES-任务下发")
|
||||
@Operation(summary = "TES-任务下发")
|
||||
@PostMapping(value = "/newMovePodTask")
|
||||
@IgnoreAuth
|
||||
public Result<String> newMovePodTask(@RequestBody NewMovePodTaskRequest newMovePodTaskRequest) {
|
||||
iTesAgvService.sendTesAgvTask(
|
||||
"http://localhost:8000/cpte-wms/tes/apiv2/newMovePodTask",
|
||||
JSON.toJSONString(newMovePodTaskRequest),
|
||||
null
|
||||
);
|
||||
return Result.OK("下发成功!");
|
||||
public TesResult newMovePodTask(@RequestBody NewMovePodTaskRequest newMovePodTaskRequest) {
|
||||
iTesAgvService.sendTesAgvTask(GeneralConstant.TES_POD_TASK, JSON.toJSONString(newMovePodTaskRequest), null);
|
||||
return TesResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -51,8 +48,8 @@ public class TesAgvController {
|
|||
*
|
||||
* @param tesCallbackRequest 请求参数
|
||||
*/
|
||||
@AutoLog(value = "TesAGV-任务上报")
|
||||
@Operation(summary = "TesAGV-任务上报")
|
||||
@AutoLog(value = "TES-任务上报")
|
||||
@Operation(summary = "TES-任务上报")
|
||||
@PostMapping(value = "/callBackTask")
|
||||
public TesResult callBackTask(@RequestBody TesCallbackRequest tesCallbackRequest) {
|
||||
try {
|
||||
|
|
@ -63,24 +60,24 @@ public class TesAgvController {
|
|||
}
|
||||
}
|
||||
|
||||
@AutoLog(value = "TesAGV-取消任务")
|
||||
@Operation(summary = "TesAGV-取消任务")
|
||||
@PostMapping(value = "/cancelTask")
|
||||
public TesResult cancelTask(@RequestBody CancelTaskRequest cancelTask) {
|
||||
@AutoLog(value = "TES-取消任务")
|
||||
@Operation(summary = "TES-取消任务")
|
||||
@PostMapping(value = "/cancelTes")
|
||||
public TesResult cancelTes(@RequestBody CancelTaskRequest cancelTask) {
|
||||
try {
|
||||
iTesAgvService.cancelTask(cancelTask);
|
||||
iTesAgvService.cancelTes(cancelTask);
|
||||
return TesResult.success();
|
||||
} catch (Exception e) {
|
||||
return TesResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@AutoLog(value = "TesAGV-重送任务")
|
||||
@Operation(summary = "TesAGV-重送任务")
|
||||
@PostMapping(value = "/resendTesTask")
|
||||
public TesResult resendTesTask(@RequestBody AgvTask agvTask) {
|
||||
@AutoLog(value = "TES-重送任务")
|
||||
@Operation(summary = "TES-重送任务")
|
||||
@PostMapping(value = "/resendTes")
|
||||
public TesResult resendTes(@RequestBody AgvTask agvTask) {
|
||||
try {
|
||||
iTesAgvService.resendTesTask(agvTask);
|
||||
iTesAgvService.resendTes(agvTask);
|
||||
return TesResult.success();
|
||||
} catch (Exception e) {
|
||||
return TesResult.error(e.getMessage());
|
||||
|
|
|
|||
|
|
@ -33,12 +33,12 @@ public interface ITesAgvService {
|
|||
*
|
||||
* @param cancelTask 取消参数
|
||||
*/
|
||||
void cancelTask(CancelTaskRequest cancelTask);
|
||||
void cancelTes(CancelTaskRequest cancelTask);
|
||||
|
||||
/**
|
||||
* 重新下发任务
|
||||
*
|
||||
* @param agvTask 待下发任务
|
||||
*/
|
||||
void resendTesTask(AgvTask agvTask);
|
||||
void resendTes(AgvTask agvTask);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ public class ITesAgvServiceImpl implements ITesAgvService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void cancelTask(CancelTaskRequest cancelTask) {
|
||||
public void cancelTes(CancelTaskRequest cancelTask) {
|
||||
AgvTask agvTask = agvTaskMapper.selectById(cancelTask.getTaskID());
|
||||
String url = openApiMapper.getRequestUrl(GeneralConstant.TES_CANCEL_TASK);
|
||||
String json = generateCancelTaskJson(agvTask);
|
||||
|
|
@ -219,7 +219,7 @@ public class ITesAgvServiceImpl implements ITesAgvService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void resendTesTask(AgvTask agvTask) {
|
||||
public void resendTes(AgvTask agvTask) {
|
||||
handleResend(agvTask);
|
||||
}
|
||||
|
||||
|
|
@ -248,7 +248,7 @@ public class ITesAgvServiceImpl implements ITesAgvService {
|
|||
if (agvTask.getIzAll() == 0) {
|
||||
//查询电梯口点位作为目标点位
|
||||
String endCode = iPointService.getElevatorPoint(agvTask.getEndCode(), GeneralConstant.CK_ELEVATOR_TASK_INDEX);
|
||||
iAgvTaskService.createAgvTask(null, agvTask.getCarrierCode(), agvTask.getEndCode(), endCode, null, BusinessTypeEnum.OUTBOUND.getValue(), AgvVendorEnum.HIK.getValue());
|
||||
iAgvTaskService.createAgvTask(null, agvTask.getCarrierCode(), agvTask.getEndCode(), endCode, null, BusinessTypeEnum.OUTBOUND.getValue(), 0,AgvVendorEnum.HIK.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -278,12 +278,12 @@ public class ITesAgvServiceImpl implements ITesAgvService {
|
|||
if (count > 0) {
|
||||
throw new RuntimeException("任务已重新生成,请勿重复操作! ");
|
||||
}
|
||||
AgvTask newAgvTask = iAgvTaskService.createAgvTask(agvTask.getBusinessDetailId(), agvTask.getCarrierCode(), agvTask.getStartCode(), agvTask.getEndCode(), null, agvTask.getType(), AgvVendorEnum.TES.getValue());
|
||||
AgvTask newAgvTask = iAgvTaskService.createAgvTask(agvTask.getBusinessDetailId(), agvTask.getCarrierCode(), agvTask.getStartCode(), agvTask.getEndCode(), null, agvTask.getType(),agvTask.getIzAll(), AgvVendorEnum.TES.getValue());
|
||||
switch (agvTask.getType()) {
|
||||
case "INBOUND":
|
||||
case "OUTBOUND":
|
||||
//下发四向车任务
|
||||
sendTesAgvTask("", "", newAgvTask);
|
||||
sendTesAgvTask(GeneralConstant.TES_POD_TASK, generateTesAgvTaskJson(newAgvTask), newAgvTask);
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("任务类型不支持: " + agvTask.getType());
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|||
import org.cpte.modules.agvTask.entity.AgvTask;
|
||||
import org.cpte.modules.base.entity.Item;
|
||||
import org.cpte.modules.base.entity.Point;
|
||||
import org.cpte.modules.base.entity.Stock;
|
||||
import org.cpte.modules.inventory.entity.Inventory;
|
||||
import org.cpte.modules.shipping.entity.PickDetail;
|
||||
import org.cpte.modules.shipping.entity.Task;
|
||||
|
|
@ -168,6 +169,48 @@ public class BatchUtil {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量插入容器数据
|
||||
*/
|
||||
@Transactional
|
||||
public void saveBatchStock(List<Stock> stocks) {
|
||||
String sql = "INSERT INTO base_stock (id,stock_code, stock_type, status, del_flag, iz_active,sys_org_code,tenant_id,create_by,create_time) VALUES (?,?,?,?,?,?,?,?,?,?)";
|
||||
batchInsert(sql, stocks, (ps, stock) -> {
|
||||
try {
|
||||
ps.setLong(1, IdWorker.getId());
|
||||
ps.setString(2, stock.getStockCode());
|
||||
ps.setString(3, stock.getStockType());
|
||||
ps.setInt(4, stock.getStatus());
|
||||
ps.setInt(5, stock.getDelFlag());
|
||||
ps.setInt(6, stock.getIzActive());
|
||||
ps.setString(7, stock.getSysOrgCode());
|
||||
ps.setLong(8, stock.getTenantId());
|
||||
ps.setString(9, stock.getCreateBy());
|
||||
ps.setDate(10, new Date(stock.getCreateTime().getTime()));
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新点位
|
||||
*/
|
||||
@Transactional
|
||||
public void batchUpdateStocks(List<Stock> stocks) {
|
||||
String sql = "UPDATE base_stock SET iz_active = ?, del_flag = ? WHERE id = ?";
|
||||
batchUpdate(sql, stocks, (ps, stock) -> {
|
||||
try {
|
||||
ps.setInt(1, stock.getIzActive());
|
||||
ps.setInt(2, stock.getDelFlag());
|
||||
ps.setLong(3, stock.getId());
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量更新出库明细
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,78 @@
|
|||
package org.cpte.modules.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.cpte.modules.constant.GeneralConstant;
|
||||
import org.cpte.modules.saiWms.request.SaiWmsRequest;
|
||||
import org.jeecg.modules.openapi.mapper.OpenApiMapper;
|
||||
import org.jeecg.modules.system.mapper.SysDictMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SwmsLoginUtil {
|
||||
|
||||
@Autowired
|
||||
private OpenApiMapper openApiMapper;
|
||||
|
||||
public String loginJson() {
|
||||
String userName = "LM";
|
||||
String password = "654321";
|
||||
|
||||
SaiWmsRequest.ParameterValue3 parameterValue1 = new SaiWmsRequest.ParameterValue3();
|
||||
parameterValue1.setValue(userName);
|
||||
|
||||
SaiWmsRequest.ParameterValue3 parameterValue2 = new SaiWmsRequest.ParameterValue3();
|
||||
parameterValue2.setValue(password);
|
||||
|
||||
SaiWmsRequest.Context context = new SaiWmsRequest.Context();
|
||||
|
||||
SaiWmsRequest saiWmsRequest = new SaiWmsRequest();
|
||||
saiWmsRequest.setApiType("AuthenticationController");
|
||||
saiWmsRequest.setParameters(List.of(parameterValue1, parameterValue2));
|
||||
saiWmsRequest.setMethod("Login");
|
||||
saiWmsRequest.setContext(context);
|
||||
return JSON.toJSONString(saiWmsRequest);
|
||||
}
|
||||
|
||||
public String Login() {
|
||||
String url = openApiMapper.getRequestUrl(GeneralConstant.Login);
|
||||
String json = loginJson();
|
||||
|
||||
log.info("登录请求报文:{}", json);
|
||||
Boolean Success = null;
|
||||
String Message = null;
|
||||
//String result = HttpPostUtil.sendPostReq(url, json);
|
||||
String result = "{\n" +
|
||||
" \"Success\": false,\n" +
|
||||
" \"Message\": \"账号[SysAdmin ]不存在或密码错误\",\n" +
|
||||
" \"Result\": null,\n" +
|
||||
" \"Context\": {\n" +
|
||||
" \"Ticket\": \"123123\"\n" +
|
||||
" }\n" +
|
||||
"}";
|
||||
if (StringUtils.isEmpty(result)) {
|
||||
Message = "登录返回信息:接口调用失败";
|
||||
throw new RuntimeException(Message);
|
||||
}
|
||||
|
||||
JSONObject resulObject = JSON.parseObject(result);
|
||||
if (resulObject == null) {
|
||||
Message = "登录返回信息:接口返回为空";
|
||||
throw new RuntimeException(Message);
|
||||
}
|
||||
|
||||
Success = resulObject.getBoolean("Success");
|
||||
Message = resulObject.getString("Message");
|
||||
|
||||
if (!Success) {
|
||||
throw new RuntimeException("登录返回信息:" + Message);
|
||||
}
|
||||
return resulObject.getJSONObject("Context").getString("Ticket");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,332 @@
|
|||
server:
|
||||
port: 8000
|
||||
tomcat:
|
||||
max-swallow-size: -1
|
||||
error:
|
||||
include-exception: true
|
||||
include-stacktrace: ALWAYS
|
||||
include-message: ALWAYS
|
||||
servlet:
|
||||
context-path: /cpte-wms
|
||||
compression:
|
||||
enabled: true
|
||||
min-response-size: 1024
|
||||
mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: metrics,httpexchanges,cptehttptrace
|
||||
|
||||
spring:
|
||||
flyway:
|
||||
# 是否启用flyway
|
||||
enabled: false
|
||||
# 是否关闭要清除已有库下的表功能,生产环境必须为true,否则会删库,非常重要!!!
|
||||
clean-disabled: true
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 10MB
|
||||
max-request-size: 10MB
|
||||
mail:
|
||||
# 定时任务发送邮件
|
||||
timeJobSend: false
|
||||
host: smtp.163.com
|
||||
username: cpteos@163.com
|
||||
password: ??
|
||||
properties:
|
||||
mail.smtp.auth: true
|
||||
smtp.ssl.enable: true
|
||||
## quartz定时任务,采用数据库方式
|
||||
quartz:
|
||||
job-store-type: jdbc
|
||||
jdbc:
|
||||
initialize-schema: embedded
|
||||
#定时任务开关,true-开 false-关
|
||||
auto-startup: true
|
||||
#延迟1秒启动定时任务
|
||||
startup-delay: 1s
|
||||
#启动时更新己存在的Job
|
||||
overwrite-existing-jobs: true
|
||||
properties:
|
||||
org:
|
||||
quartz:
|
||||
scheduler:
|
||||
instanceName: MyScheduler
|
||||
instanceId: AUTO
|
||||
jobStore:
|
||||
class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
|
||||
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
|
||||
tablePrefix: QRTZ_
|
||||
isClustered: true
|
||||
misfireThreshold: 12000
|
||||
clusterCheckinInterval: 15000
|
||||
threadPool:
|
||||
class: org.quartz.simpl.SimpleThreadPool
|
||||
threadCount: 10
|
||||
threadPriority: 5
|
||||
threadsInheritContextClassLoaderOfInitializingThread: true
|
||||
#json 时间戳统一转换
|
||||
jackson:
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
jpa:
|
||||
open-in-view: false
|
||||
aop:
|
||||
proxy-target-class: true
|
||||
#配置freemarker
|
||||
freemarker:
|
||||
# 设置模板后缀名
|
||||
suffix: .ftl
|
||||
# 设置文档类型
|
||||
content-type: text/html
|
||||
# 设置页面编码格式
|
||||
charset: UTF-8
|
||||
# 设置页面缓存
|
||||
cache: false
|
||||
prefer-file-system-access: false
|
||||
# 设置ftl文件路径
|
||||
template-loader-path:
|
||||
- classpath:/templates
|
||||
template_update_delay: 0
|
||||
# 设置静态文件路径,js,css等
|
||||
mvc:
|
||||
static-path-pattern: /**
|
||||
#Spring Boot 2.6+后映射匹配的默认策略已从AntPathMatcher更改为PathPatternParser,需要手动指定为ant-path-matcher
|
||||
pathmatch:
|
||||
matching-strategy: ant_path_matcher
|
||||
resource:
|
||||
static-locations: classpath:/static/,classpath:/public/
|
||||
autoconfigure:
|
||||
exclude:
|
||||
- com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure
|
||||
- org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration
|
||||
datasource:
|
||||
druid:
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
loginUsername: admin
|
||||
loginPassword: 123456
|
||||
allow:
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
dynamic:
|
||||
druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
|
||||
# 连接池的配置信息
|
||||
# 初始化大小,最小,最大
|
||||
initial-size: 5
|
||||
min-idle: 5
|
||||
maxActive: 1000
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
# 打开PSCache,并且指定每个连接上PSCache的大小
|
||||
poolPreparedStatements: true
|
||||
maxPoolPreparedStatementPerConnectionSize: 20
|
||||
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
|
||||
filters: stat,slf4j
|
||||
# 允许SELECT语句的WHERE子句是一个永真条件
|
||||
wall:
|
||||
selectWhereAlwayTrueCheck: false
|
||||
# 打开mergeSql功能;慢SQL记录
|
||||
stat:
|
||||
merge-sql: true
|
||||
slow-sql-millis: 5000
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://10.180.9.60:3306/cpte-wms?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: cpte@123
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 多数据源配置
|
||||
#multi-datasource1:
|
||||
#url: jdbc:mysql://10.180.9.60:3306/cpte-wms?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
#username: root
|
||||
#password: root
|
||||
#driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
#redis 配置
|
||||
data:
|
||||
redis:
|
||||
database: 0
|
||||
#host: 10.180.9.60
|
||||
host: 10.180.9.60
|
||||
port: 6379
|
||||
password: cpte@123
|
||||
#mybatis plus 设置
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:org/jeecg/**/xml/*Mapper.xml,classpath*:org/cpte/**/xml/*Mapper.xml
|
||||
global-config:
|
||||
# 关闭MP3.0自带的banner
|
||||
banner: false
|
||||
db-config:
|
||||
#主键类型 0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
|
||||
id-type: ASSIGN_ID
|
||||
# 默认数据库表下划线命名
|
||||
table-underline: true
|
||||
configuration:
|
||||
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
|
||||
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
# 返回类型为Map,显示null对应的字段
|
||||
call-setters-on-nulls: true
|
||||
#jeecg专用配置
|
||||
minidao:
|
||||
base-package: org.jeecg.modules.jmreport.*,org.jeecg.modules.drag.*
|
||||
jeecg:
|
||||
# AI集成
|
||||
ai-chat:
|
||||
enabled: true
|
||||
model: deepseek-chat
|
||||
apiKey: ??
|
||||
apiHost: https://api.deepseek.com
|
||||
timeout: 60
|
||||
# AIRag向量库
|
||||
ai-rag:
|
||||
embed-store:
|
||||
host: 127.0.0.1
|
||||
port: 5432
|
||||
database: postgres
|
||||
user: postgres
|
||||
password: postgres
|
||||
table: embeddings
|
||||
# 平台上线安全配置
|
||||
firewall:
|
||||
# 数据源安全 (开启后,Online报表和图表的数据源为必填)
|
||||
dataSourceSafe: true
|
||||
# 低代码模式(dev:开发模式,prod:发布模式——关闭所有在线开发配置能力)
|
||||
lowCodeMode: prod
|
||||
# 签名密钥串(前后端要一致,正式发布请自行修改)
|
||||
signatureSecret: dd05f1c54d63749eda95f9fa6d49v442a
|
||||
#签名拦截接口
|
||||
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys,/sys/sendChangePwdSms,/sys/user/sendChangePhoneSms,/sys/sms,/desform/api/sendVerifyCode
|
||||
# local\minio\alioss
|
||||
uploadType: alioss
|
||||
# 前端访问地址
|
||||
domainUrl:
|
||||
pc: http://localhost:8080
|
||||
app: http://localhost:8051
|
||||
path:
|
||||
#文件上传根目录 设置
|
||||
upload: /home/wms/upload
|
||||
#webapp文件路径
|
||||
webapp: /home/wms/webapp
|
||||
shiro:
|
||||
excludeUrls: /test/cpteDemo/demo3,/test/cpteDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**,/api/getUserInfo
|
||||
#阿里云oss存储和大鱼短信秘钥配置
|
||||
oss:
|
||||
accessKey: ??
|
||||
secretKey: ??
|
||||
endpoint: oss-cn-beijing.aliyuncs.com
|
||||
bucketName: cptedev
|
||||
staticDomain: https://static.cpte.com
|
||||
# 短信模板
|
||||
sms-template:
|
||||
# 签名
|
||||
signature:
|
||||
# 模板code
|
||||
templateCode:
|
||||
# 登录短信、忘记密码模板编码
|
||||
SMS_175435174:
|
||||
# 修改密码短信模板编码
|
||||
SMS_465391221:
|
||||
# 注册账号短信模板编码
|
||||
SMS_175430166:
|
||||
SMS_461885023:
|
||||
# 在线预览文件服务器地址配置
|
||||
file-view-domain: http://fileview.cpte.com
|
||||
# minio文件上传
|
||||
minio:
|
||||
minio_url: http://minio.cpte.com
|
||||
minio_name: ??
|
||||
minio_pass: ??
|
||||
bucketName: otatest
|
||||
#大屏报表参数设置
|
||||
jmreport:
|
||||
#多租户模式,默认值为空(created:按照创建人隔离、tenant:按照租户隔离) (v1.6.2+ 新增)
|
||||
saasMode:
|
||||
# 平台上线安全配置(v1.6.2+ 新增)
|
||||
firewall:
|
||||
# 数据源安全 (开启后,不允许使用平台数据源、SQL解析加签并且不允许查询数据库)
|
||||
dataSourceSafe: true
|
||||
# 低代码开发模式(dev:开发模式,prod:发布模式—关闭在线报表设计功能,分配角色admin、lowdeveloper可以放开限制)
|
||||
lowCodeMode: prod
|
||||
# 高德地图Api配置(v2.1.3+ BI新增高德地图)
|
||||
gao-de-api:
|
||||
# 应用key
|
||||
api-key: ??
|
||||
# 应用秘钥
|
||||
secret-key: ??
|
||||
#xxl-job配置
|
||||
xxljob:
|
||||
enabled: false
|
||||
adminAddresses: http://127.0.0.1:9080/xxl-job-admin
|
||||
appname: ${spring.application.name}
|
||||
accessToken: ''
|
||||
address: 127.0.0.1:30007
|
||||
ip: 127.0.0.1
|
||||
port: 30007
|
||||
logPath: logs/cpte/job/jobhandler/
|
||||
logRetentionDays: 30
|
||||
#分布式锁配置
|
||||
redisson:
|
||||
#address: 10.180.9.60:6379
|
||||
address: 10.180.9.60:6379
|
||||
password: cpte@123
|
||||
type: STANDALONE
|
||||
enabled: true
|
||||
# 百度开放API配置
|
||||
baidu-api:
|
||||
app-id: ??
|
||||
api-key: ??
|
||||
secret-key: ??
|
||||
#cas单点登录
|
||||
cas:
|
||||
prefixUrl: http://cas.example.org:8443/cas
|
||||
#Mybatis输出sql日志
|
||||
logging:
|
||||
level:
|
||||
org.springframework.context.support.PostProcessorRegistrationDelegate: error
|
||||
org.flywaydb: debug
|
||||
org.jeecg.modules.system.mapper: info
|
||||
#swagger
|
||||
knife4j:
|
||||
#开启增强配置
|
||||
enable: true
|
||||
#开启生产环境屏蔽
|
||||
production: true
|
||||
basic:
|
||||
enable: true
|
||||
username: cpte
|
||||
password: cpte1314
|
||||
#第三方登录
|
||||
justauth:
|
||||
enabled: true
|
||||
type:
|
||||
GITHUB:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
redirect-uri: http://sso.test.com:8000/cpte-wms/sys/thirdLogin/github/callback
|
||||
WECHAT_ENTERPRISE:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
redirect-uri: http://sso.test.com:8000/cpte-wms/sys/thirdLogin/wechat_enterprise/callback
|
||||
agent-id: ??
|
||||
DINGTALK:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
redirect-uri: http://sso.test.com:8000/cpte-wms/sys/thirdLogin/dingtalk/callback
|
||||
WECHAT_OPEN:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
redirect-uri: http://sso.test.com:8000/cpte-wms/sys/thirdLogin/wechat_open/callback
|
||||
cache:
|
||||
type: default
|
||||
prefix: 'demo::'
|
||||
timeout: 1h
|
||||
|
|
@ -114,7 +114,7 @@ spring:
|
|||
stat-view-servlet:
|
||||
enabled: true
|
||||
loginUsername: admin
|
||||
loginPassword: 123456
|
||||
loginPassword: cpte@123
|
||||
allow:
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
|
|
@ -162,9 +162,9 @@ spring:
|
|||
data:
|
||||
redis:
|
||||
database: 0
|
||||
host: 127.0.0.1
|
||||
host: 47.117.45.79
|
||||
port: 6379
|
||||
password:
|
||||
password: cpte@123
|
||||
#mybatis plus 设置
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:org/jeecg/**/xml/*Mapper.xml,classpath*:org/cpte/**/xml/*Mapper.xml
|
||||
|
|
@ -178,7 +178,7 @@ mybatis-plus:
|
|||
table-underline: true
|
||||
configuration:
|
||||
# # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
# 返回类型为Map,显示null对应的字段
|
||||
call-setters-on-nulls: true
|
||||
#jeecg专用配置
|
||||
|
|
@ -219,9 +219,9 @@ jeecg:
|
|||
app: http://localhost:8051
|
||||
path:
|
||||
#文件上传根目录 设置
|
||||
upload: /opt/upFiles
|
||||
upload: /home/wms/java/upFiles
|
||||
#webapp文件路径
|
||||
webapp: /opt/webapp
|
||||
webapp: /home/wms/java/webapp
|
||||
shiro:
|
||||
excludeUrls: /test/cpteDemo/demo3,/test/cpteDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**
|
||||
#阿里云oss存储和大鱼短信秘钥配置
|
||||
|
|
@ -279,8 +279,8 @@ jeecg:
|
|||
logRetentionDays: 30
|
||||
#分布式锁配置
|
||||
redisson:
|
||||
address: 127.0.0.1:6379
|
||||
password:
|
||||
address: 47.117.45.79:6379
|
||||
password: cpte@123
|
||||
type: STANDALONE
|
||||
enabled: true
|
||||
# 百度开放API配置
|
||||
|
|
|
|||
|
|
@ -142,13 +142,13 @@ spring:
|
|||
slow-sql-millis: 5000
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://10.180.9.60:3306/cpte-wms?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
|
||||
url: jdbc:mysql://10.254.27.192:3306/cpte-wms?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: cpte@123
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 多数据源配置
|
||||
#multi-datasource1:
|
||||
#url: jdbc:mysql://localhost:3306/cpte-wms?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
#multi-datasource1:10.180.9.60 10.254.27.192
|
||||
#url: jdbc:mysql://10.180.9.60:3306/cpte-wms?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
#username: root
|
||||
#password: root
|
||||
#driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
|
@ -156,7 +156,8 @@ spring:
|
|||
data:
|
||||
redis:
|
||||
database: 0
|
||||
host: 10.180.9.60
|
||||
#host: 10.180.9.60
|
||||
host: 10.254.27.192
|
||||
port: 6379
|
||||
password: cpte@123
|
||||
#mybatis plus 设置
|
||||
|
|
@ -275,8 +276,9 @@ jeecg:
|
|||
logRetentionDays: 30
|
||||
#分布式锁配置
|
||||
redisson:
|
||||
address: 127.0.0.1:6379
|
||||
password:
|
||||
#address: 10.180.9.60:6379
|
||||
address: 10.254.27.192:6379
|
||||
password: cpte@123
|
||||
type: STANDALONE
|
||||
enabled: true
|
||||
# 百度开放API配置
|
||||
|
|
|
|||
18
pom.xml
18
pom.xml
|
|
@ -663,6 +663,24 @@
|
|||
<config.password></config.password>
|
||||
</properties>
|
||||
</profile>
|
||||
<!-- cpte -->
|
||||
<profile>
|
||||
<id>cpte</id>
|
||||
<properties>
|
||||
<!--当前环境-->
|
||||
<profile.name>cpte</profile.name>
|
||||
<!--Nacos服务地址-->
|
||||
<config.server-addr>cpte-boot-nacos:8848</config.server-addr>
|
||||
<!--Nacos配置中心命名空间,用于支持多环境.这里必须使用ID,不能使用名称,默认为空-->
|
||||
<config.namespace>springboot3</config.namespace>
|
||||
<!--Nacos配置分组名称-->
|
||||
<config.group>DEFAULT_GROUP</config.group>
|
||||
<!--Nacos用户名-->
|
||||
<config.username></config.username>
|
||||
<!--Nacos密码-->
|
||||
<config.password></config.password>
|
||||
</properties>
|
||||
</profile>
|
||||
<!-- docker打包用 -->
|
||||
<profile>
|
||||
<id>docker</id>
|
||||
|
|
|
|||
Loading…
Reference in New Issue