Merge branch '0.8.X' of http://49.232.154.205:10100/DeXun/klp-oa into 0.8.X
This commit is contained in:
@@ -6,6 +6,7 @@ import java.util.Date;
|
|||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import com.klp.domain.vo.WmsMaterialCoilBindVo;
|
import com.klp.domain.vo.WmsMaterialCoilBindVo;
|
||||||
|
import com.klp.domain.vo.WmsDeliveryCoilRelationVo;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@@ -71,6 +72,17 @@ public class WmsDeliveryWaybillDetailController extends BaseController {
|
|||||||
return R.ok(iWmsDeliveryWaybillDetailService.queryById(detailId));
|
return R.ok(iWmsDeliveryWaybillDetailService.queryById(detailId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据钢卷ID查询发货关联信息(发货单明细+发货单+发货计划+钢卷信息)
|
||||||
|
*
|
||||||
|
* @param coilId 钢卷ID
|
||||||
|
*/
|
||||||
|
@GetMapping("/coilRelation/{coilId}")
|
||||||
|
public R<WmsDeliveryCoilRelationVo> getCoilRelation(@NotNull(message = "钢卷ID不能为空")
|
||||||
|
@PathVariable Long coilId) {
|
||||||
|
return R.ok(iWmsDeliveryWaybillDetailService.queryRelationByCoilId(coilId));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增发货单明细
|
* 新增发货单明细
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,183 @@
|
|||||||
|
package com.klp.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据钢卷ID查询发货关联信息VO
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2025-11-25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsDeliveryCoilRelationVo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
// ==================== 发货单明细信息 ====================
|
||||||
|
/**
|
||||||
|
* 明细唯一ID
|
||||||
|
*/
|
||||||
|
private Long detailId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联发货单主表ID
|
||||||
|
*/
|
||||||
|
private Long waybillId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联钢卷表ID
|
||||||
|
*/
|
||||||
|
private Long coilId;
|
||||||
|
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
private String edgeType;
|
||||||
|
|
||||||
|
private String packaging;
|
||||||
|
|
||||||
|
private String settlementType;
|
||||||
|
|
||||||
|
private String rawMaterialFactory;
|
||||||
|
|
||||||
|
private String coilNo;
|
||||||
|
|
||||||
|
private String specification;
|
||||||
|
|
||||||
|
private String material;
|
||||||
|
|
||||||
|
private Long quantity;
|
||||||
|
|
||||||
|
private BigDecimal weight;
|
||||||
|
|
||||||
|
private BigDecimal unitPrice;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
// ==================== 发货单信息 ====================
|
||||||
|
/**
|
||||||
|
* 发货单唯一ID
|
||||||
|
*/
|
||||||
|
private Long waybillId2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发货单编号
|
||||||
|
*/
|
||||||
|
private String waybillNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发货单名称
|
||||||
|
*/
|
||||||
|
private String waybillName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联发货计划ID
|
||||||
|
*/
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车牌
|
||||||
|
*/
|
||||||
|
private String licensePlate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货单位
|
||||||
|
*/
|
||||||
|
private String consigneeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发货单位
|
||||||
|
*/
|
||||||
|
private String senderUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发货时间
|
||||||
|
*/
|
||||||
|
private Date deliveryTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 磅房
|
||||||
|
*/
|
||||||
|
private String weighbridge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 销售
|
||||||
|
*/
|
||||||
|
private String salesPerson;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责人
|
||||||
|
*/
|
||||||
|
private String principal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责人电话
|
||||||
|
*/
|
||||||
|
private String principalPhone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成状态(0=待发货,1=已发货,2=已完成,3=取消)
|
||||||
|
*/
|
||||||
|
private Long status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发货单备注
|
||||||
|
*/
|
||||||
|
private String waybillRemark;
|
||||||
|
|
||||||
|
// ==================== 发货计划信息 ====================
|
||||||
|
/**
|
||||||
|
* 计划唯一ID
|
||||||
|
*/
|
||||||
|
private Long planId2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发货计划名称
|
||||||
|
*/
|
||||||
|
private String planName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划日期
|
||||||
|
*/
|
||||||
|
private Date planDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划类型: 发货0,收货1
|
||||||
|
*/
|
||||||
|
private Integer planType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划备注
|
||||||
|
*/
|
||||||
|
private String planRemark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态
|
||||||
|
*/
|
||||||
|
private Integer auditStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核人
|
||||||
|
*/
|
||||||
|
private String auditBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核时间
|
||||||
|
*/
|
||||||
|
private Date auditTime;
|
||||||
|
|
||||||
|
// ==================== 钢卷信息 ====================
|
||||||
|
/**
|
||||||
|
* 入场钢卷号
|
||||||
|
*/
|
||||||
|
private String enterCoilNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前钢卷号
|
||||||
|
*/
|
||||||
|
private String currentCoilNo;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.klp.service;
|
|||||||
|
|
||||||
import com.klp.domain.WmsDeliveryWaybillDetail;
|
import com.klp.domain.WmsDeliveryWaybillDetail;
|
||||||
import com.klp.domain.vo.WmsDeliveryWaybillDetailVo;
|
import com.klp.domain.vo.WmsDeliveryWaybillDetailVo;
|
||||||
|
import com.klp.domain.vo.WmsDeliveryCoilRelationVo;
|
||||||
import com.klp.domain.bo.WmsDeliveryWaybillDetailBo;
|
import com.klp.domain.bo.WmsDeliveryWaybillDetailBo;
|
||||||
import com.klp.common.core.page.TableDataInfo;
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
import com.klp.common.core.domain.PageQuery;
|
import com.klp.common.core.domain.PageQuery;
|
||||||
@@ -23,6 +24,11 @@ public interface IWmsDeliveryWaybillDetailService {
|
|||||||
*/
|
*/
|
||||||
WmsDeliveryWaybillDetailVo queryById(Long detailId);
|
WmsDeliveryWaybillDetailVo queryById(Long detailId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据钢卷ID查询发货关联信息(发货单明细+发货单+发货计划+钢卷信息)
|
||||||
|
*/
|
||||||
|
WmsDeliveryCoilRelationVo queryRelationByCoilId(Long coilId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询发货单明细列表
|
* 查询发货单明细列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -8,15 +8,18 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.klp.common.exception.ServiceException;
|
import com.klp.common.exception.ServiceException;
|
||||||
import com.klp.common.utils.StringUtils;
|
import com.klp.common.utils.StringUtils;
|
||||||
|
import com.klp.domain.WmsDeliveryPlan;
|
||||||
import com.klp.domain.WmsDeliveryWaybill;
|
import com.klp.domain.WmsDeliveryWaybill;
|
||||||
import com.klp.domain.WmsDeliveryWaybillDetail;
|
import com.klp.domain.WmsDeliveryWaybillDetail;
|
||||||
import com.klp.domain.WmsMaterialCoil;
|
import com.klp.domain.WmsMaterialCoil;
|
||||||
|
import com.klp.mapper.WmsDeliveryPlanMapper;
|
||||||
import com.klp.mapper.WmsDeliveryWaybillDetailMapper;
|
import com.klp.mapper.WmsDeliveryWaybillDetailMapper;
|
||||||
import com.klp.mapper.WmsDeliveryWaybillMapper;
|
import com.klp.mapper.WmsDeliveryWaybillMapper;
|
||||||
import com.klp.mapper.WmsMaterialCoilMapper;
|
import com.klp.mapper.WmsMaterialCoilMapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.klp.domain.bo.WmsDeliveryWaybillDetailBo;
|
import com.klp.domain.bo.WmsDeliveryWaybillDetailBo;
|
||||||
|
import com.klp.domain.vo.WmsDeliveryCoilRelationVo;
|
||||||
import com.klp.domain.vo.WmsDeliveryWaybillDetailVo;
|
import com.klp.domain.vo.WmsDeliveryWaybillDetailVo;
|
||||||
import com.klp.domain.vo.WmsCoilBindInfoVo;
|
import com.klp.domain.vo.WmsCoilBindInfoVo;
|
||||||
import com.klp.service.IWmsDeliveryWaybillDetailService;
|
import com.klp.service.IWmsDeliveryWaybillDetailService;
|
||||||
@@ -40,6 +43,8 @@ public class WmsDeliveryWaybillDetailServiceImpl implements IWmsDeliveryWaybillD
|
|||||||
|
|
||||||
private final WmsMaterialCoilMapper wmsMaterialCoilMapper;
|
private final WmsMaterialCoilMapper wmsMaterialCoilMapper;
|
||||||
|
|
||||||
|
private final WmsDeliveryPlanMapper wmsDeliveryPlanMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询发货单明细
|
* 查询发货单明细
|
||||||
*/
|
*/
|
||||||
@@ -48,6 +53,90 @@ public class WmsDeliveryWaybillDetailServiceImpl implements IWmsDeliveryWaybillD
|
|||||||
return baseMapper.selectVoById(detailId);
|
return baseMapper.selectVoById(detailId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据钢卷ID查询发货关联信息(发货单明细+发货单+发货计划+钢卷信息)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WmsDeliveryCoilRelationVo queryRelationByCoilId(Long coilId) {
|
||||||
|
if (coilId == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询发货单明细
|
||||||
|
LambdaQueryWrapper<WmsDeliveryWaybillDetail> detailWrapper = Wrappers.lambdaQuery();
|
||||||
|
detailWrapper.eq(WmsDeliveryWaybillDetail::getCoilId, coilId);
|
||||||
|
detailWrapper.eq(WmsDeliveryWaybillDetail::getDelFlag, 0);
|
||||||
|
WmsDeliveryWaybillDetail detail = baseMapper.selectOne(detailWrapper);
|
||||||
|
|
||||||
|
if (detail == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
WmsDeliveryCoilRelationVo vo = new WmsDeliveryCoilRelationVo();
|
||||||
|
|
||||||
|
// 发货单明细信息
|
||||||
|
vo.setDetailId(detail.getDetailId());
|
||||||
|
vo.setWaybillId(detail.getWaybillId());
|
||||||
|
vo.setCoilId(detail.getCoilId());
|
||||||
|
vo.setProductName(detail.getProductName());
|
||||||
|
vo.setEdgeType(detail.getEdgeType());
|
||||||
|
vo.setPackaging(detail.getPackaging());
|
||||||
|
vo.setSettlementType(detail.getSettlementType());
|
||||||
|
vo.setRawMaterialFactory(detail.getRawMaterialFactory());
|
||||||
|
vo.setCoilNo(detail.getCoilNo());
|
||||||
|
vo.setSpecification(detail.getSpecification());
|
||||||
|
vo.setMaterial(detail.getMaterial());
|
||||||
|
vo.setQuantity(detail.getQuantity());
|
||||||
|
vo.setWeight(detail.getWeight());
|
||||||
|
vo.setUnitPrice(detail.getUnitPrice());
|
||||||
|
vo.setRemark(detail.getRemark());
|
||||||
|
|
||||||
|
if (detail.getWaybillId() != null) {
|
||||||
|
// 查询发货单信息
|
||||||
|
WmsDeliveryWaybill waybill = wmsDeliveryWaybillMapper.selectById(detail.getWaybillId());
|
||||||
|
if (waybill != null) {
|
||||||
|
vo.setWaybillId2(waybill.getWaybillId());
|
||||||
|
vo.setWaybillNo(waybill.getWaybillNo());
|
||||||
|
vo.setWaybillName(waybill.getWaybillName());
|
||||||
|
vo.setPlanId(waybill.getPlanId());
|
||||||
|
vo.setLicensePlate(waybill.getLicensePlate());
|
||||||
|
vo.setConsigneeUnit(waybill.getConsigneeUnit());
|
||||||
|
vo.setSenderUnit(waybill.getSenderUnit());
|
||||||
|
vo.setDeliveryTime(waybill.getDeliveryTime());
|
||||||
|
vo.setWeighbridge(waybill.getWeighbridge());
|
||||||
|
vo.setSalesPerson(waybill.getSalesPerson());
|
||||||
|
vo.setPrincipal(waybill.getPrincipal());
|
||||||
|
vo.setPrincipalPhone(waybill.getPrincipalPhone());
|
||||||
|
vo.setStatus(waybill.getStatus());
|
||||||
|
vo.setWaybillRemark(waybill.getRemark());
|
||||||
|
|
||||||
|
if (waybill.getPlanId() != null) {
|
||||||
|
// 查询发货计划信息
|
||||||
|
WmsDeliveryPlan plan = wmsDeliveryPlanMapper.selectById(waybill.getPlanId());
|
||||||
|
if (plan != null) {
|
||||||
|
vo.setPlanId2(plan.getPlanId());
|
||||||
|
vo.setPlanName(plan.getPlanName());
|
||||||
|
vo.setPlanDate(plan.getPlanDate());
|
||||||
|
vo.setPlanType(plan.getPlanType());
|
||||||
|
vo.setPlanRemark(plan.getRemark());
|
||||||
|
vo.setAuditStatus(plan.getAuditStatus());
|
||||||
|
vo.setAuditBy(plan.getAuditBy());
|
||||||
|
vo.setAuditTime(plan.getAuditTime());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询钢卷信息
|
||||||
|
WmsMaterialCoil coil = wmsMaterialCoilMapper.selectById(coilId);
|
||||||
|
if (coil != null) {
|
||||||
|
vo.setEnterCoilNo(coil.getEnterCoilNo());
|
||||||
|
vo.setCurrentCoilNo(coil.getCurrentCoilNo());
|
||||||
|
}
|
||||||
|
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询发货单明细列表
|
* 查询发货单明细列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1045,14 +1045,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
SELECT DISTINCT mci.enter_coil_no
|
SELECT DISTINCT mci.enter_coil_no
|
||||||
FROM wms_material_coil mci
|
FROM wms_material_coil mci
|
||||||
LEFT JOIN wms_raw_material rm ON mci.item_type = 'raw_material' AND mci.item_id = rm.raw_material_id AND rm.del_flag = 0
|
LEFT JOIN wms_raw_material rm ON mci.item_type = 'raw_material' AND mci.item_id = rm.raw_material_id AND rm.del_flag = 0
|
||||||
LEFT JOIN wms_product wp ON mci.item_type = 'product' AND mci.item_id = wp.product_id AND wp.del_flag = 0
|
|
||||||
WHERE mci.del_flag = 0
|
WHERE mci.del_flag = 0
|
||||||
AND mci.item_id IS NOT NULL
|
AND mci.item_id IS NOT NULL
|
||||||
AND (
|
AND (mci.item_type = 'raw_material' AND rm.raw_material_name LIKE '%热轧卷板%')
|
||||||
(mci.item_type = 'raw_material' AND rm.raw_material_name LIKE '%热轧卷板%')
|
|
||||||
OR
|
|
||||||
(mci.item_type = 'product' AND wp.product_name LIKE '%热轧卷板%')
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
AND (
|
AND (
|
||||||
mc.packing_status IS NULL
|
mc.packing_status IS NULL
|
||||||
@@ -1061,14 +1056,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
SELECT 1
|
SELECT 1
|
||||||
FROM wms_material_coil mci2
|
FROM wms_material_coil mci2
|
||||||
LEFT JOIN wms_raw_material rm2 ON mci2.item_type = 'raw_material' AND mci2.item_id = rm2.raw_material_id AND rm2.del_flag = 0
|
LEFT JOIN wms_raw_material rm2 ON mci2.item_type = 'raw_material' AND mci2.item_id = rm2.raw_material_id AND rm2.del_flag = 0
|
||||||
LEFT JOIN wms_product wp2 ON mci2.item_type = 'product' AND mci2.item_id = wp2.product_id AND wp2.del_flag = 0
|
|
||||||
WHERE mci2.del_flag = 0
|
WHERE mci2.del_flag = 0
|
||||||
AND mci2.enter_coil_no = mc.enter_coil_no
|
AND mci2.enter_coil_no = mc.enter_coil_no
|
||||||
AND (
|
AND (mci2.item_type = 'raw_material' AND rm2.raw_material_name LIKE '%热轧卷板%' AND (mc.packing_status != rm2.material OR rm2.material IS NULL))
|
||||||
(mci2.item_type = 'raw_material' AND rm2.raw_material_name LIKE '%热轧卷板%' AND (mc.packing_status != rm2.material OR rm2.material IS NULL))
|
|
||||||
OR
|
|
||||||
(mci2.item_type = 'product' AND wp2.product_name LIKE '%热轧卷板%' AND (mc.packing_status != wp2.material OR wp2.material IS NULL))
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user