feat(销售出货): 明细查询增加销售订单需求等级

This commit is contained in:
faramita 2024-12-13 16:01:58 +08:00
parent 4e22b50543
commit 8ce9be73c5
4 changed files with 27 additions and 1 deletions

View File

@ -363,6 +363,9 @@ public class DocumentDetailed extends Model<DocumentDetailed> {
@ApiModelProperty(value="特殊库存标识")
private String inventorySpecialMarking;
@TableField(exist = false)
private String qualityInspectionStatus;
public static String genHandle(String documentBo, String item, Integer seq) {
return HandleBoProcessor.genHandle(KW_WMS_DOCUMENT_DETAILED_BO,documentBo,item ,seq.toString());

View File

@ -6328,7 +6328,7 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
if (!(Constant.DOCUMENT_STATUS_SUBMIT.equals(byId.getState()) || Constant.DOCUMENT_STATUS_PICKING.equals(byId.getState()) || Constant.DOCUMENT_STATUS_TBC.equals(byId.getState()) || Constant.DOCUMENT_STATUS_POST.equals(byId.getState()) || Constant.DOCUMENT_STATUS_CLOSE.equals(byId.getState()))) {
throw BusinessException.build("此单据状态未提交");
} else {
List<DocumentDetailed> documentDetail = getDocumentDetail(site, documentNo);
List<DocumentDetailed> documentDetail = Constant.DOCUMENT_SALES_OUT.equalsIgnoreCase(byId.getDocumentType()) ? getDocumentDetailWithSaleOrder(site, documentNo) : getDocumentDetail(site, documentNo);
if (CollectionUtil.isEmpty(documentDetail)) {
throw BusinessException.build("单据" + documentNo + "无明细项");
} else {
@ -6371,6 +6371,10 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
return documentDetailedService.lambdaQuery().eq(DocumentDetailed::getDocumentBo, Document.genHandle(site, documentNo)).ne(DocumentDetailed::getState, Constant.DOCUMENT_STATUS_CANCEL).orderByAsc(DocumentDetailed::getSeq).list();
}
private List<DocumentDetailed> getDocumentDetailWithSaleOrder(String site, String documentNo) {
return documentDetailedMapper.selectWithSalesOrder(Wrappers.lambdaQuery(DocumentDetailed.class).eq(DocumentDetailed::getDocumentBo, Document.genHandle(site, documentNo)).ne(DocumentDetailed::getState, Constant.DOCUMENT_STATUS_CANCEL).orderByAsc(DocumentDetailed::getSeq));
}
private void updateDocumentAndDetailStatus(String user, String documentBo, LocalDateTime localDateTime, String status) {
LocalDateTime now = Optional.ofNullable(localDateTime).orElse(LocalDateTime.now());
lambdaUpdate().eq(Document::getHandle, documentBo)

View File

@ -1,6 +1,8 @@
package com.foreverwin.mom.wms.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.foreverwin.mom.common.data.datascope.MomBaseMapper;
import com.foreverwin.mom.wms.dto.ItemDto;
import com.foreverwin.mom.wms.entity.DocumentDetailed;
@ -54,4 +56,6 @@ public interface DocumentDetailedMapper extends MomBaseMapper<DocumentDetailed>
List<DocumentDetailed> getDocumentDetailedList(@Param("site") String site,@Param("documentNo") String documentNo);
IPage<DocumentDetailed> selectByType(IPage iPage, @Param("site") String site, @Param("documentNo") String documentNo, @Param("documentTypes") List<String> documentTypes);
List<DocumentDetailed> selectWithSalesOrder(@Param("ew") Wrapper<DocumentDetailed> wrapper);
}

View File

@ -42,6 +42,7 @@
<result property="shopOrderBo" column="SHOP_ORDER_BO"/>
<result property="targetSalesOrder" column="TARGET_SALES_ORDER"/>
<result property="targetSalesOrderSeq" column="TARGET_SALES_ORDER_SEQ"/>
<result property="qualityInspectionStatus" column="QUALITY_INSPECTION_STATUS"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
@ -200,4 +201,18 @@
</where>
ORDER BY ZDD.CREATE_DATE_TIME DESC,ZDD.DOCUMENT_NO ;
</select>
<select id="selectWithSalesOrder" resultMap="documentDetailedMap">
SELECT X.*, SOL.QUALITY_INSPECTION_STATUS
FROM (
SELECT *
FROM Z_DOCUMENT_DETAILED
<where>
<if test="ew!=null and ew.sqlSegment!=null">
${ew.sqlSegment}
</if>
</where>
) AS X
LEFT JOIN WIP.Z_SALES_ORDER_LINE AS SOL ON SOL.HANDLE = CONCAT('SalesOrderLineBO:SalesOrderBO:', X.SITE, ',', X.SALES_ORDER, ',', X.SALES_ORDER_SEQ)
</select>
</mapper>