执行及取消执行;nc推送客户nc编码查询逻辑修改;
This commit is contained in:
+9
-1
@@ -23,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import com.mhd.common.core.utils.StringUtils;
|
import com.mhd.common.core.utils.StringUtils;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -98,6 +99,13 @@ public class WarehouseApplicationService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
String orgIds = warehouseDO.getOrgIds();
|
||||||
|
if (StringUtils.isNotEmpty(orgIds)) {
|
||||||
|
String[] orgIdArray = orgIds.split(",");
|
||||||
|
List<Long> orgIdList = Arrays.stream(orgIdArray).map(Long::valueOf).collect(Collectors.toList());
|
||||||
|
warehouseDO.setOrgIdList(orgIdList);
|
||||||
|
warehouseDO.setOrganizationId(null);
|
||||||
|
}
|
||||||
return warehouseDomainService.queryList(warehouseDO);
|
return warehouseDomainService.queryList(warehouseDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -314,4 +322,4 @@ public class WarehouseApplicationService {
|
|||||||
return warehouseDomainService.getWarehouseChildren(warehouseId, storageLocationType);
|
return warehouseDomainService.getWarehouseChildren(warehouseId, storageLocationType);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+3
-1
@@ -128,5 +128,7 @@ public class WarehouseDO extends BaseVOEntity{
|
|||||||
@ApiModelProperty("仓库id 集合")
|
@ApiModelProperty("仓库id 集合")
|
||||||
private List<Long> warehouseIds;
|
private List<Long> warehouseIds;
|
||||||
@ApiModelProperty("组织id 集合")
|
@ApiModelProperty("组织id 集合")
|
||||||
private List<Long> orgIds;
|
private String orgIds;
|
||||||
|
@ApiModelProperty("组织id 集合")
|
||||||
|
private List<Long> orgIdList;
|
||||||
}
|
}
|
||||||
+3
-1
@@ -133,5 +133,7 @@ public class WarehouseDTO extends BaseVOEntity{
|
|||||||
@Excel(name = "是否启用: 1-否 2-是")
|
@Excel(name = "是否启用: 1-否 2-是")
|
||||||
private Integer isEnable;
|
private Integer isEnable;
|
||||||
@ApiModelProperty("组织id 集合")
|
@ApiModelProperty("组织id 集合")
|
||||||
private List<Long> orgIds;
|
private String orgIds;
|
||||||
|
@ApiModelProperty("组织id 集合")
|
||||||
|
private List<Long> orgIdList;
|
||||||
}
|
}
|
||||||
+2
-2
@@ -130,9 +130,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="orgIds != null and orgIds.size > 0 ">
|
<if test="orgIdList != null and orgIdList.size > 0 ">
|
||||||
and organization_id in
|
and organization_id in
|
||||||
<foreach collection="orgIds" item="item" index="index" open="(" close=")" separator=",">
|
<foreach collection="orgIdList" item="item" index="index" open="(" close=")" separator=",">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
+2
@@ -25,6 +25,8 @@ public interface BillManageMapper extends BaseMapper<BillManage>
|
|||||||
|
|
||||||
String getCustomerCodeNc(@Param("actualInvoiceCustomerId") String actualInvoiceCustomerId);
|
String getCustomerCodeNc(@Param("actualInvoiceCustomerId") String actualInvoiceCustomerId);
|
||||||
|
|
||||||
|
String getCustomerCodeNcJson(@Param("actualInvoiceCustomerId") String actualInvoiceCustomerId);
|
||||||
|
|
||||||
String getDocumentPreparerNcCode(@Param("salesmanId") String salesmanId);
|
String getDocumentPreparerNcCode(@Param("salesmanId") String salesmanId);
|
||||||
|
|
||||||
String getsalespersonNcCode(@Param("salesmanId") String salesmanId);
|
String getsalespersonNcCode(@Param("salesmanId") String salesmanId);
|
||||||
|
|||||||
+53
@@ -1,9 +1,13 @@
|
|||||||
package com.mhd.bms.domain.billManage.repository.persistence;
|
package com.mhd.bms.domain.billManage.repository.persistence;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.mhd.bms.domain.billManage.entity.BillManage;
|
import com.mhd.bms.domain.billManage.entity.BillManage;
|
||||||
import com.mhd.bms.domain.billManage.repository.facade.IBillManageService;
|
import com.mhd.bms.domain.billManage.repository.facade.IBillManageService;
|
||||||
@@ -66,6 +70,7 @@ import java.text.SimpleDateFormat;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账单管理Service业务层处理
|
* 账单管理Service业务层处理
|
||||||
@@ -211,6 +216,26 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
|||||||
String appointShipper=make.getActualInvoiceCustomerName();
|
String appointShipper=make.getActualInvoiceCustomerName();
|
||||||
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
|
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
|
||||||
String customerCodeNc = billManageMapper.getCustomerCodeNc(actualInvoiceCustomerId);
|
String customerCodeNc = billManageMapper.getCustomerCodeNc(actualInvoiceCustomerId);
|
||||||
|
String customerCodeNcJson = billManageMapper.getCustomerCodeNcJson(actualInvoiceCustomerId);
|
||||||
|
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
List<Map<String, Object>> listNc = objectMapper.readValue(
|
||||||
|
customerCodeNcJson,
|
||||||
|
new TypeReference<List<Map<String, Object>>>() {}
|
||||||
|
);
|
||||||
|
if (listNc != null && listNc.size() > 0) {
|
||||||
|
Map<String, Object> targetMap = listNc.stream()
|
||||||
|
.filter(map -> {
|
||||||
|
Object codeObj = map.get("code");
|
||||||
|
return codeObj != null && codeObj.toString().equals(reconciliation.getOrganizationId().toString());
|
||||||
|
})
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
if (targetMap != null) {
|
||||||
|
customerCodeNc = (String) targetMap.get("ncCustomer");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
String settlementCurrency=reconciliation.getSettlementCurrency();
|
String settlementCurrency=reconciliation.getSettlementCurrency();
|
||||||
String orgCodeNc = billManageMapper.getOrgCodeNc(organizationId);
|
String orgCodeNc = billManageMapper.getOrgCodeNc(organizationId);
|
||||||
String documentPreparerNcCode = billManageMapper.getDocumentPreparerNcCode(salesmanId);
|
String documentPreparerNcCode = billManageMapper.getDocumentPreparerNcCode(salesmanId);
|
||||||
@@ -436,6 +461,10 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
|||||||
reconciliation.setSynchronousStatus(2);
|
reconciliation.setSynchronousStatus(2);
|
||||||
billManageMapper.updateById(reconciliation);
|
billManageMapper.updateById(reconciliation);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
} catch (JsonMappingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -528,6 +557,26 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
|||||||
String appointShipper=make.getActualInvoiceCustomerName();
|
String appointShipper=make.getActualInvoiceCustomerName();
|
||||||
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
|
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
|
||||||
String customerCodeNc = billManageMapper.getCustomerCodeNc(actualInvoiceCustomerId);
|
String customerCodeNc = billManageMapper.getCustomerCodeNc(actualInvoiceCustomerId);
|
||||||
|
String customerCodeNcJson = billManageMapper.getCustomerCodeNcJson(actualInvoiceCustomerId);
|
||||||
|
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
List<Map<String, Object>> listNc = objectMapper.readValue(
|
||||||
|
customerCodeNcJson,
|
||||||
|
new TypeReference<List<Map<String, Object>>>() {}
|
||||||
|
);
|
||||||
|
if (listNc != null && listNc.size() > 0) {
|
||||||
|
Map<String, Object> targetMap = listNc.stream()
|
||||||
|
.filter(map -> {
|
||||||
|
Object codeObj = map.get("code");
|
||||||
|
return codeObj != null && codeObj.toString().equals(reconciliation.getOrganizationId().toString());
|
||||||
|
})
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
if (targetMap != null) {
|
||||||
|
customerCodeNc = (String) targetMap.get("ncCustomer");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
String documentPreparerNcCode = billManageMapper.getDocumentPreparerNcCode(salesmanId);
|
String documentPreparerNcCode = billManageMapper.getDocumentPreparerNcCode(salesmanId);
|
||||||
String settlementCurrency=reconciliation.getSettlementCurrency();
|
String settlementCurrency=reconciliation.getSettlementCurrency();
|
||||||
String settlementCurrencyNcCode = settlementCurrency;
|
String settlementCurrencyNcCode = settlementCurrency;
|
||||||
@@ -722,6 +771,10 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
|||||||
reconciliation.setSynchronousStatus(2);
|
reconciliation.setSynchronousStatus(2);
|
||||||
billManageMapper.updateById(reconciliation);
|
billManageMapper.updateById(reconciliation);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
} catch (JsonMappingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,6 +118,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
SELECT CUSTOMER_NC_CODE FROM NGWL_TEST_USER."USER_SHIPPER" where del_flag = 1 and SHIPPER_ID = #{actualInvoiceCustomerId} limit 1
|
SELECT CUSTOMER_NC_CODE FROM NGWL_TEST_USER."USER_SHIPPER" where del_flag = 1 and SHIPPER_ID = #{actualInvoiceCustomerId} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getCustomerCodeNcJson" parameterType="java.lang.String" resultType="java.lang.String">
|
||||||
|
SELECT ORG_CODE FROM NGWL_TEST_USER."USER_SHIPPER" where del_flag = 1 and SHIPPER_ID = #{actualInvoiceCustomerId} limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getDocumentPreparerNcCode" parameterType="java.lang.String" resultType="java.lang.String">
|
<select id="getDocumentPreparerNcCode" parameterType="java.lang.String" resultType="java.lang.String">
|
||||||
SELECT DOCUMENT_PREPARER_NC_CODE FROM NGWL_TEST_USER."USER" where del_flag = 1 and user_id = #{salesmanId} limit 1
|
SELECT DOCUMENT_PREPARER_NC_CODE FROM NGWL_TEST_USER."USER" where del_flag = 1 and user_id = #{salesmanId} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
+2
@@ -39,6 +39,8 @@ public interface ReconciliationMapper extends BaseMapper<Reconciliation>
|
|||||||
|
|
||||||
String getCustomerCodeNc(@Param("actualInvoiceCustomerId") String actualInvoiceCustomerId);
|
String getCustomerCodeNc(@Param("actualInvoiceCustomerId") String actualInvoiceCustomerId);
|
||||||
|
|
||||||
|
String getCustomerCodeNcJson(@Param("actualInvoiceCustomerId") String actualInvoiceCustomerId);
|
||||||
|
|
||||||
String getDocumentPreparerNcCode(@Param("salesmanId") String salesmanId);
|
String getDocumentPreparerNcCode(@Param("salesmanId") String salesmanId);
|
||||||
|
|
||||||
String getSettlementCurrencyNcCode(@Param("settlementCurrency") String settlementCurrency);
|
String getSettlementCurrencyNcCode(@Param("settlementCurrency") String settlementCurrency);
|
||||||
|
|||||||
+99
@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.linke.finance.domain.approvalDocument.entity.ApprovalDocument;
|
import com.linke.finance.domain.approvalDocument.entity.ApprovalDocument;
|
||||||
import com.linke.finance.domain.approvalDocument.repository.mapper.ApprovalDocumentMapper;
|
import com.linke.finance.domain.approvalDocument.repository.mapper.ApprovalDocumentMapper;
|
||||||
@@ -725,6 +727,26 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
|||||||
String appointShipper=make.getActualInvoiceCustomerName();
|
String appointShipper=make.getActualInvoiceCustomerName();
|
||||||
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
|
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
|
||||||
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
|
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
|
||||||
|
String customerCodeNcJson = reconciliationMapper.getCustomerCodeNcJson(actualInvoiceCustomerId);
|
||||||
|
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
List<Map<String, Object>> list = objectMapper.readValue(
|
||||||
|
customerCodeNcJson,
|
||||||
|
new TypeReference<List<Map<String, Object>>>() {}
|
||||||
|
);
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
Map<String, Object> targetMap = list.stream()
|
||||||
|
.filter(map -> {
|
||||||
|
Object codeObj = map.get("code");
|
||||||
|
return codeObj != null && codeObj.toString().equals(reconciliation.getOrganizationId().toString());
|
||||||
|
})
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
if (targetMap != null) {
|
||||||
|
customerCodeNc = (String) targetMap.get("ncCustomer");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
String settlementCurrency=order.getSettlementCurrency();
|
String settlementCurrency=order.getSettlementCurrency();
|
||||||
String salesmanId = order.getSalesmanId();
|
String salesmanId = order.getSalesmanId();
|
||||||
String customerUserDept = reconciliationMapper.getCustomerUserDept(salesmanId);
|
String customerUserDept = reconciliationMapper.getCustomerUserDept(salesmanId);
|
||||||
@@ -952,6 +974,10 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
|||||||
reconciliation.setSynchronousStatus(2);
|
reconciliation.setSynchronousStatus(2);
|
||||||
reconciliationMapper.updateById(reconciliation);
|
reconciliationMapper.updateById(reconciliation);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
} catch (JsonMappingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1008,6 +1034,27 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
|||||||
String appointShipper=make.getActualInvoiceCustomerName();
|
String appointShipper=make.getActualInvoiceCustomerName();
|
||||||
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
|
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
|
||||||
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
|
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
|
||||||
|
String customerCodeNcJson = reconciliationMapper.getCustomerCodeNcJson(actualInvoiceCustomerId);
|
||||||
|
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
List<Map<String, Object>> list = objectMapper.readValue(
|
||||||
|
customerCodeNcJson,
|
||||||
|
new TypeReference<List<Map<String, Object>>>() {}
|
||||||
|
);
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
Map<String, Object> targetMap = list.stream()
|
||||||
|
.filter(map -> {
|
||||||
|
Object codeObj = map.get("code");
|
||||||
|
return codeObj != null && codeObj.toString().equals(reconciliation.getOrganizationId().toString());
|
||||||
|
})
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
if (targetMap != null) {
|
||||||
|
customerCodeNc = (String) targetMap.get("ncCustomer");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String settlementCurrency=order.getSettlementCurrency();
|
String settlementCurrency=order.getSettlementCurrency();
|
||||||
String salesmanId = order.getSalesmanId();
|
String salesmanId = order.getSalesmanId();
|
||||||
String customerUserDept = reconciliationMapper.getCustomerUserDept(salesmanId);
|
String customerUserDept = reconciliationMapper.getCustomerUserDept(salesmanId);
|
||||||
@@ -1235,6 +1282,10 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
|||||||
reconciliation.setSynchronousStatus(2);
|
reconciliation.setSynchronousStatus(2);
|
||||||
reconciliationMapper.updateById(reconciliation);
|
reconciliationMapper.updateById(reconciliation);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
} catch (JsonMappingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1560,6 +1611,26 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
|||||||
String appointShipper=make.getActualInvoiceCustomerName();
|
String appointShipper=make.getActualInvoiceCustomerName();
|
||||||
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
|
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
|
||||||
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
|
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
|
||||||
|
String customerCodeNcJson = reconciliationMapper.getCustomerCodeNcJson(actualInvoiceCustomerId);
|
||||||
|
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
List<Map<String, Object>> listNc = objectMapper.readValue(
|
||||||
|
customerCodeNcJson,
|
||||||
|
new TypeReference<List<Map<String, Object>>>() {}
|
||||||
|
);
|
||||||
|
if (listNc != null && listNc.size() > 0) {
|
||||||
|
Map<String, Object> targetMap = listNc.stream()
|
||||||
|
.filter(map -> {
|
||||||
|
Object codeObj = map.get("code");
|
||||||
|
return codeObj != null && codeObj.toString().equals(reconciliation.getOrganizationId().toString());
|
||||||
|
})
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
if (targetMap != null) {
|
||||||
|
customerCodeNc = (String) targetMap.get("ncCustomer");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
String documentPreparerNcCode = reconciliationMapper.getDocumentPreparerNcCode(salesmanId);
|
String documentPreparerNcCode = reconciliationMapper.getDocumentPreparerNcCode(salesmanId);
|
||||||
String settlementCurrency=order.getSettlementCurrency();
|
String settlementCurrency=order.getSettlementCurrency();
|
||||||
String settlementCurrencyNcCode = settlementCurrency;
|
String settlementCurrencyNcCode = settlementCurrency;
|
||||||
@@ -1759,6 +1830,10 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
|||||||
reconciliation.setSynchronousStatus(2);
|
reconciliation.setSynchronousStatus(2);
|
||||||
reconciliationMapper.updateById(reconciliation);
|
reconciliationMapper.updateById(reconciliation);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
} catch (JsonMappingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1844,6 +1919,26 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
|||||||
String appointShipper=make.getActualInvoiceCustomerName();
|
String appointShipper=make.getActualInvoiceCustomerName();
|
||||||
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
|
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
|
||||||
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
|
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
|
||||||
|
String customerCodeNcJson = reconciliationMapper.getCustomerCodeNcJson(actualInvoiceCustomerId);
|
||||||
|
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
List<Map<String, Object>> listNc = objectMapper.readValue(
|
||||||
|
customerCodeNcJson,
|
||||||
|
new TypeReference<List<Map<String, Object>>>() {}
|
||||||
|
);
|
||||||
|
if (listNc != null && listNc.size() > 0) {
|
||||||
|
Map<String, Object> targetMap = listNc.stream()
|
||||||
|
.filter(map -> {
|
||||||
|
Object codeObj = map.get("code");
|
||||||
|
return codeObj != null && codeObj.toString().equals(reconciliation.getOrganizationId().toString());
|
||||||
|
})
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
if (targetMap != null) {
|
||||||
|
customerCodeNc = (String) targetMap.get("ncCustomer");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
String documentPreparerNcCode = reconciliationMapper.getDocumentPreparerNcCode(salesmanId);
|
String documentPreparerNcCode = reconciliationMapper.getDocumentPreparerNcCode(salesmanId);
|
||||||
String settlementCurrency=order.getSettlementCurrency();
|
String settlementCurrency=order.getSettlementCurrency();
|
||||||
String settlementCurrencyNcCode = settlementCurrency;
|
String settlementCurrencyNcCode = settlementCurrency;
|
||||||
@@ -2046,6 +2141,10 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
|||||||
reconciliation.setSynchronousStatus(2);
|
reconciliation.setSynchronousStatus(2);
|
||||||
reconciliationMapper.updateById(reconciliation);
|
reconciliationMapper.updateById(reconciliation);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
} catch (JsonMappingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -373,6 +373,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
SELECT CUSTOMER_NC_CODE FROM NGWL_TEST_USER."USER_SHIPPER" where del_flag = 1 and SHIPPER_ID = #{actualInvoiceCustomerId} limit 1
|
SELECT CUSTOMER_NC_CODE FROM NGWL_TEST_USER."USER_SHIPPER" where del_flag = 1 and SHIPPER_ID = #{actualInvoiceCustomerId} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getCustomerCodeNcJson" parameterType="java.lang.String" resultType="java.lang.String">
|
||||||
|
SELECT ORG_CODE FROM NGWL_TEST_USER."USER_SHIPPER" where del_flag = 1 and SHIPPER_ID = #{actualInvoiceCustomerId} limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getDocumentPreparerNcCode" parameterType="java.lang.String" resultType="java.lang.String">
|
<select id="getDocumentPreparerNcCode" parameterType="java.lang.String" resultType="java.lang.String">
|
||||||
SELECT DOCUMENT_PREPARER_NC_CODE FROM NGWL_TEST_USER."USER" where del_flag = 1 and user_id = #{salesmanId} limit 1
|
SELECT DOCUMENT_PREPARER_NC_CODE FROM NGWL_TEST_USER."USER" where del_flag = 1 and user_id = #{salesmanId} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
+4
@@ -61,6 +61,10 @@ public class ExecutionStockInOrder extends BaseVOEntity {
|
|||||||
@Excel(name = "入库单号")
|
@Excel(name = "入库单号")
|
||||||
private String inOrderNumber;
|
private String inOrderNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty("入库业务单号")
|
||||||
|
@Excel(name = "入库业务单号")
|
||||||
|
private String businessInOrderNumber;
|
||||||
|
|
||||||
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
||||||
@Excel(name = "入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
@Excel(name = "入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|||||||
+6
@@ -45,6 +45,12 @@ public interface ExecutionStockInOrderMapper extends BaseMapper<ExecutionStockIn
|
|||||||
|
|
||||||
public void delWOrderDetail(@Param("inOrderNumber") String inOrderNumber);
|
public void delWOrderDetail(@Param("inOrderNumber") String inOrderNumber);
|
||||||
|
|
||||||
|
public String getWShOrder(@Param("inOrderNumber") String inOrderNumber);
|
||||||
|
|
||||||
|
public void delWShOrder(@Param("inOrderNumber") String inOrderNumber);
|
||||||
|
|
||||||
|
public void delWShOrderDetail(@Param("receiptOrderNumber") String receiptOrderNumber);
|
||||||
|
|
||||||
|
|
||||||
List<ExecutionStockInOrderPO> queryNoticePrint(ExecutionStockInOrderDO stockInOrderDO);
|
List<ExecutionStockInOrderPO> queryNoticePrint(ExecutionStockInOrderDO stockInOrderDO);
|
||||||
List<ExecutionInMaterialDetailPO> queryNoticePrintDetail(ExecutionStockInOrderDO stockInOrderDO);
|
List<ExecutionInMaterialDetailPO> queryNoticePrintDetail(ExecutionStockInOrderDO stockInOrderDO);
|
||||||
|
|||||||
+5
-2
@@ -440,13 +440,16 @@ public class ExecutionStockInOrderDomainService {
|
|||||||
|
|
||||||
//逻辑删除w入库单信息
|
//逻辑删除w入库单信息
|
||||||
List<Long> inOrderIds = stockInOrderDO.getInOrderIds();
|
List<Long> inOrderIds = stockInOrderDO.getInOrderIds();
|
||||||
if (inOrderIds == null || inOrderIds.isEmpty()) {
|
if (inOrderIds != null && !inOrderIds.isEmpty()) {
|
||||||
for (Long inOrderId : inOrderIds) {
|
for (Long inOrderId : inOrderIds) {
|
||||||
ExecutionStockInOrder executionStockInOrder = reservationStockInOrderMapper.selectById(inOrderId);
|
ExecutionStockInOrder executionStockInOrder = reservationStockInOrderMapper.selectById(inOrderId);
|
||||||
if (executionStockInOrder != null) {
|
if (executionStockInOrder != null) {
|
||||||
String inOrderNumber = executionStockInOrder.getInOrderNumber();
|
String inOrderNumber = executionStockInOrder.getInOrderNumber();
|
||||||
reservationStockInOrderMapper.delWOrder(inOrderNumber);
|
reservationStockInOrderMapper.delWOrder(inOrderNumber);
|
||||||
reservationStockInOrderMapper.delWOrderDetail(inOrderNumber);
|
reservationStockInOrderMapper.delWOrderDetail(inOrderNumber);
|
||||||
|
String wShOrder = reservationStockInOrderMapper.getWShOrder(inOrderNumber);
|
||||||
|
reservationStockInOrderMapper.delWShOrder(inOrderNumber);
|
||||||
|
reservationStockInOrderMapper.delWShOrderDetail(wShOrder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -458,7 +461,7 @@ public class ExecutionStockInOrderDomainService {
|
|||||||
.set(ExecutionStockInOrder::getUpdateBy, loginUser.getUserid())
|
.set(ExecutionStockInOrder::getUpdateBy, loginUser.getUserid())
|
||||||
.set(ExecutionStockInOrder::getUpdateByName, userRealName)
|
.set(ExecutionStockInOrder::getUpdateByName, userRealName)
|
||||||
.set(ExecutionStockInOrder::getUpdateTime, new Date())
|
.set(ExecutionStockInOrder::getUpdateTime, new Date())
|
||||||
.set(ExecutionStockInOrder::getIssueStatus, issueStatus)
|
.set(ExecutionStockInOrder::getIssueStatus, 0)
|
||||||
.in(ExecutionStockInOrder::getInOrderId, stockInOrderDO.getInOrderIds()));
|
.in(ExecutionStockInOrder::getInOrderId, stockInOrderDO.getInOrderIds()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
@@ -50,6 +50,10 @@ public class ExecutionStockOutOrder extends BaseVOEntity {
|
|||||||
@Excel(name = "出库单号")
|
@Excel(name = "出库单号")
|
||||||
private String outOrderNumber;
|
private String outOrderNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty("出库单号")
|
||||||
|
@Excel(name = "出库单号")
|
||||||
|
private String businessOutOrderNumber;
|
||||||
|
|
||||||
@ApiModelProperty("出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核")
|
@ApiModelProperty("出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核")
|
||||||
@Excel(name = "出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核")
|
@Excel(name = "出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|||||||
+1
-1
@@ -327,7 +327,7 @@ public class ExecutionStockOutOrderDomainService {
|
|||||||
.set(ExecutionStockOutOrder::getUpdateBy, loginUser.getUserid())
|
.set(ExecutionStockOutOrder::getUpdateBy, loginUser.getUserid())
|
||||||
.set(ExecutionStockOutOrder::getUpdateByName, userRealName)
|
.set(ExecutionStockOutOrder::getUpdateByName, userRealName)
|
||||||
.set(ExecutionStockOutOrder::getUpdateTime, new Date())
|
.set(ExecutionStockOutOrder::getUpdateTime, new Date())
|
||||||
.set(ExecutionStockOutOrder::getIssueStatus, issueStatus)
|
.set(ExecutionStockOutOrder::getIssueStatus, 0)
|
||||||
.in(ExecutionStockOutOrder::getOutOrderId, stockOutOrderDO.getOutOrderIds()));
|
.in(ExecutionStockOutOrder::getOutOrderId, stockOutOrderDO.getOutOrderIds()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
@@ -333,6 +333,10 @@ public class ReservationStockInOrderApplicationService {
|
|||||||
return stockInOrderDomainService.issueOrder(stockInOrderDO);
|
return stockInOrderDomainService.issueOrder(stockInOrderDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean executeAndIssue(ReservationStockInOrderDO stockInOrderDO){
|
||||||
|
return stockInOrderDomainService.executeAndIssue(stockInOrderDO);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 取消入库单
|
* @description 取消入库单
|
||||||
* @author ZhouGY
|
* @author ZhouGY
|
||||||
|
|||||||
+120
-15
@@ -17,6 +17,8 @@ import com.mhd.oms.domain.executionInMaterialDetail.entity.ExecutionInMaterialDe
|
|||||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.facade.IExecutionInMaterialDetailService;
|
import com.mhd.oms.domain.executionInMaterialDetail.repository.facade.IExecutionInMaterialDetailService;
|
||||||
import com.mhd.oms.domain.executionStockInOrder.entity.ExecutionStockInOrder;
|
import com.mhd.oms.domain.executionStockInOrder.entity.ExecutionStockInOrder;
|
||||||
import com.mhd.oms.domain.executionStockInOrder.repository.facade.IExecutionStockInOrderService;
|
import com.mhd.oms.domain.executionStockInOrder.repository.facade.IExecutionStockInOrderService;
|
||||||
|
import com.mhd.oms.domain.executionStockInOrder.repository.todo.ExecutionStockInOrderDO;
|
||||||
|
import com.mhd.oms.domain.executionStockInOrder.service.ExecutionStockInOrderApplicationService;
|
||||||
import com.mhd.oms.domain.reservationInMaterialDetail.entity.ReservationInMaterialDetail;
|
import com.mhd.oms.domain.reservationInMaterialDetail.entity.ReservationInMaterialDetail;
|
||||||
import com.mhd.oms.domain.reservationInMaterialDetail.repository.facade.IReservationInMaterialDetailService;
|
import com.mhd.oms.domain.reservationInMaterialDetail.repository.facade.IReservationInMaterialDetailService;
|
||||||
import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ReservationInMaterialDetailPO;
|
import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ReservationInMaterialDetailPO;
|
||||||
@@ -73,29 +75,16 @@ public class ReservationStockInOrderDomainService {
|
|||||||
private IExecutionInMaterialDetailService executionInMaterialDetailService;
|
private IExecutionInMaterialDetailService executionInMaterialDetailService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IReservationStockOutOrderService stockOutOrderService;
|
private IReservationStockOutOrderService stockOutOrderService;
|
||||||
// @Autowired
|
|
||||||
// private ReservationStockReceiptOrderDomainService stockReceiptOrderDomainService;
|
|
||||||
// @Autowired
|
|
||||||
// private ReservationStockShelfOrderDomainService stockShelfOrderDomainService;
|
|
||||||
// @Autowired
|
|
||||||
// private IMaterialBaseInfoService materialBaseInfoService;
|
|
||||||
// @Autowired
|
|
||||||
// private IMaterialGoodsRuleService materialGoodsRuleService;
|
|
||||||
// @Autowired
|
|
||||||
// private IMaterialWarehouseControlService materialWarehouseControlService;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SystemServiceFeign systemServiceFeign;
|
private SystemServiceFeign systemServiceFeign;
|
||||||
@Autowired
|
@Autowired
|
||||||
private WmsServiceFeign wmsServiceFeign;
|
private WmsServiceFeign wmsServiceFeign;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ReservationStockInOrderMapper reservationStockInOrderMapper;
|
private ReservationStockInOrderMapper reservationStockInOrderMapper;
|
||||||
|
@Autowired
|
||||||
|
private ExecutionStockInOrderApplicationService stockInOrderApplicationService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private BusinessDocumentOrderMapper businessDocumentOrderMapper;
|
private BusinessDocumentOrderMapper businessDocumentOrderMapper;
|
||||||
// @Autowired
|
|
||||||
// private IReceiptMaterialDetailService receiptMaterialDetailService;
|
|
||||||
// @Autowired
|
|
||||||
// private IShelfMaterialDetailService shelfMaterialDetailService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询入库单列表
|
* 分页查询入库单列表
|
||||||
@@ -514,6 +503,12 @@ public class ReservationStockInOrderDomainService {
|
|||||||
reservationStockInOrder.setTopOrganizationId(topOrgId);
|
reservationStockInOrder.setTopOrganizationId(topOrgId);
|
||||||
reservationStockInOrder.setWarehouseCode(warehouseCode);
|
reservationStockInOrder.setWarehouseCode(warehouseCode);
|
||||||
reservationStockInOrder.setWarehouseName(warehouseName);
|
reservationStockInOrder.setWarehouseName(warehouseName);
|
||||||
|
reservationStockInOrder.setBusinessInOrderNumber(inOrderNumber);
|
||||||
|
if (materialDetailGroupByWarehouse!=null&&materialDetailGroupByWarehouse.size()>1) {
|
||||||
|
reservationStockInOrder.setInOrderNumber(OrderSequence.getOrderCode("RK"));
|
||||||
|
} else {
|
||||||
|
reservationStockInOrder.setInOrderNumber(inOrderNumber);
|
||||||
|
}
|
||||||
|
|
||||||
List<ExecutionInMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
List<ExecutionInMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||||
int index = 1;
|
int index = 1;
|
||||||
@@ -526,6 +521,7 @@ public class ReservationStockInOrderDomainService {
|
|||||||
reservationInMaterialDetail.setTopOrganizationId(topOrgId);
|
reservationInMaterialDetail.setTopOrganizationId(topOrgId);
|
||||||
reservationInMaterialDetail.setWarehouseCode(warehouseCode);
|
reservationInMaterialDetail.setWarehouseCode(warehouseCode);
|
||||||
reservationInMaterialDetail.setWarehouseName(warehouseName);
|
reservationInMaterialDetail.setWarehouseName(warehouseName);
|
||||||
|
reservationInMaterialDetail.setInOrderNumber(reservationStockInOrder.getInOrderNumber());
|
||||||
// String lot = generateDateSerialNumber();
|
// String lot = generateDateSerialNumber();
|
||||||
// lot = lot+"-"+index;
|
// lot = lot+"-"+index;
|
||||||
// index++;
|
// index++;
|
||||||
@@ -543,6 +539,115 @@ public class ReservationStockInOrderDomainService {
|
|||||||
return update;
|
return update;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean executeAndIssue(ReservationStockInOrderDO stockInOrderDO) {
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
|
||||||
|
// 获取用户姓名(优先从UserPo获取,如果为空则使用realname,最后使用username作为兜底)
|
||||||
|
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
|
||||||
|
? loginUser.getUserPo().getUserName()
|
||||||
|
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
|
||||||
|
boolean update = stockInOrderService.update(null, new UpdateWrapper<ReservationStockInOrder>().lambda()
|
||||||
|
.set(ReservationStockInOrder::getIssueId, loginUser.getUserid())
|
||||||
|
.set(ReservationStockInOrder::getIssueName, userRealName)
|
||||||
|
.set(ReservationStockInOrder::getIssueTime, new Date())
|
||||||
|
//.set(ReservationStockInOrder::getIssueStatus, 1)
|
||||||
|
.set(ReservationStockInOrder::getUpdateBy, loginUser.getUserid())
|
||||||
|
.set(ReservationStockInOrder::getUpdateByName, userRealName)
|
||||||
|
.set(ReservationStockInOrder::getUpdateTime, new Date())
|
||||||
|
.in(ReservationStockInOrder::getInOrderId, stockInOrderDO.getInOrderIds()));
|
||||||
|
|
||||||
|
//todo下发推送到wms
|
||||||
|
// List<Long> inOrderIds = stockInOrderDO.getInOrderIds();
|
||||||
|
// for (Long inOrderId : inOrderIds) {
|
||||||
|
// ReservationStockInOrder byId = stockInOrderService.getById(inOrderId);
|
||||||
|
// StockInOrder stockInOrder = new StockInOrder();
|
||||||
|
// BeanUtils.copyProperties(byId, stockInOrder,"inOrderId");
|
||||||
|
// stockInOrder.setOmsStockInOrderId(String.valueOf(byId.getInOrderId()));
|
||||||
|
// wmsServiceFeign.omsInOrderAdd(stockInOrder);
|
||||||
|
// String inOrderNumber = stockInOrder.getInOrderNumber();
|
||||||
|
// List<ReservationInMaterialDetail> materialDetailList = materialDetailService.list(new QueryWrapper<ReservationInMaterialDetail>().lambda().eq(ReservationInMaterialDetail::getInOrderNumber, inOrderNumber));
|
||||||
|
// List<InMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||||
|
// for (ReservationInMaterialDetail reservationInMaterialDetail : materialDetailList) {
|
||||||
|
// InMaterialDetail inMaterialDetail = new InMaterialDetail();
|
||||||
|
// BeanUtils.copyProperties(reservationInMaterialDetail, inMaterialDetail,"materialDetailId");
|
||||||
|
// inMaterialDetail.setOmsInMaterialDetail(String.valueOf(reservationInMaterialDetail.getMaterialDetailId()));
|
||||||
|
// inMaterialDetailList.add(inMaterialDetail);
|
||||||
|
// }
|
||||||
|
// wmsServiceFeign.omsInOrderAddDetail(inMaterialDetailList);
|
||||||
|
// }
|
||||||
|
//todo下发推送到入库业务单
|
||||||
|
List<Long> inOrderIds = stockInOrderDO.getInOrderIds();
|
||||||
|
for (Long inOrderId : inOrderIds) {
|
||||||
|
// Long inOrderId = stockInOrderDO.getInOrderId();
|
||||||
|
ReservationStockInOrder byId = stockInOrderService.getById(inOrderId);
|
||||||
|
String inOrderNumber = byId.getInOrderNumber();
|
||||||
|
List<ReservationInMaterialDetail> materialDetailList = materialDetailService.list(new QueryWrapper<ReservationInMaterialDetail>().lambda().eq(ReservationInMaterialDetail::getInOrderNumber, inOrderNumber));
|
||||||
|
|
||||||
|
// 按照 warehouseId 分组
|
||||||
|
Map<Long, List<ReservationInMaterialDetail>> materialDetailGroupByWarehouse = materialDetailList.stream()
|
||||||
|
.collect(Collectors.groupingBy(ReservationInMaterialDetail::getWarehouseId));
|
||||||
|
materialDetailGroupByWarehouse.forEach((warehouseId, details) -> {
|
||||||
|
Long topOrgId = reservationStockInOrderMapper.getTopOrgId(warehouseId);
|
||||||
|
Long orgId = reservationStockInOrderMapper.getOrgId(warehouseId);
|
||||||
|
String orgName = reservationStockInOrderMapper.getOrgName(warehouseId);
|
||||||
|
String warehouseCode = reservationStockInOrderMapper.getWarehouseCode(warehouseId);
|
||||||
|
String warehouseName = reservationStockInOrderMapper.getWarehouseName(warehouseId);
|
||||||
|
|
||||||
|
ExecutionStockInOrder reservationStockInOrder = new ExecutionStockInOrder();
|
||||||
|
BeanUtils.copyProperties(byId, reservationStockInOrder,"inOrderId","issueStatus","issueTime","issueId","issueName","reservationAuditId","reservationAuditName","reservationAuditTime");
|
||||||
|
reservationStockInOrder.setIssueStatus(0);
|
||||||
|
reservationStockInOrder.setOrderTypeCode("pu_tong_ru_ku");
|
||||||
|
reservationStockInOrder.setOrderTypeName("普通入库");
|
||||||
|
reservationStockInOrder.setReservationOrderSource("客户预约");
|
||||||
|
reservationStockInOrder.setWarehouseId(warehouseId);
|
||||||
|
reservationStockInOrder.setOrganizationId(orgId);
|
||||||
|
reservationStockInOrder.setOrganizationName(orgName);
|
||||||
|
reservationStockInOrder.setTopOrganizationId(topOrgId);
|
||||||
|
reservationStockInOrder.setWarehouseCode(warehouseCode);
|
||||||
|
reservationStockInOrder.setWarehouseName(warehouseName);
|
||||||
|
reservationStockInOrder.setBusinessInOrderNumber(inOrderNumber);
|
||||||
|
if (materialDetailGroupByWarehouse!=null&&materialDetailGroupByWarehouse.size()>1) {
|
||||||
|
reservationStockInOrder.setInOrderNumber(OrderSequence.getOrderCode("RK"));
|
||||||
|
} else {
|
||||||
|
reservationStockInOrder.setInOrderNumber(inOrderNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ExecutionInMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||||
|
int index = 1;
|
||||||
|
for (ReservationInMaterialDetail reserveInMaterialDetail : details) {
|
||||||
|
ExecutionInMaterialDetail reservationInMaterialDetail = new ExecutionInMaterialDetail();
|
||||||
|
BeanUtils.copyProperties(reserveInMaterialDetail, reservationInMaterialDetail,"materialDetailId");
|
||||||
|
reservationInMaterialDetail.setQuantity(reserveInMaterialDetail.getQuantity());
|
||||||
|
reservationInMaterialDetail.setOrganizationId(orgId);
|
||||||
|
reservationInMaterialDetail.setOrganizationName(orgName);
|
||||||
|
reservationInMaterialDetail.setTopOrganizationId(topOrgId);
|
||||||
|
reservationInMaterialDetail.setWarehouseCode(warehouseCode);
|
||||||
|
reservationInMaterialDetail.setWarehouseName(warehouseName);
|
||||||
|
reservationInMaterialDetail.setInOrderNumber(reservationStockInOrder.getInOrderNumber());
|
||||||
|
// String lot = generateDateSerialNumber();
|
||||||
|
// lot = lot+"-"+index;
|
||||||
|
// index++;
|
||||||
|
// reservationInMaterialDetail.setLotNo(lot);
|
||||||
|
inMaterialDetailList.add(reservationInMaterialDetail);
|
||||||
|
}
|
||||||
|
BigDecimal quantity = details.stream().map(ReservationInMaterialDetail::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
reservationStockInOrder.setQuantity(quantity);
|
||||||
|
executionStockInOrderService.save(reservationStockInOrder);
|
||||||
|
ExecutionStockInOrderDO param = new ExecutionStockInOrderDO();
|
||||||
|
Long inOrderId1 = reservationStockInOrder.getInOrderId();
|
||||||
|
List<Long> inOrderIdList1 = new ArrayList<>();
|
||||||
|
inOrderIdList1.add(inOrderId1);
|
||||||
|
param.setInOrderIds(inOrderIdList1);
|
||||||
|
stockInOrderApplicationService.issueOrder(param);
|
||||||
|
executionInMaterialDetailService.saveBatch(inMaterialDetailList);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return update;
|
||||||
|
}
|
||||||
|
|
||||||
public String generateDateSerialNumber() {
|
public String generateDateSerialNumber() {
|
||||||
// 1. 获取当前时间,格式化为:yyMMdd (2位年+2位月+2位日)
|
// 1. 获取当前时间,格式化为:yyMMdd (2位年+2位月+2位日)
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
|
||||||
|
|||||||
+4
@@ -854,6 +854,10 @@ public class ReservationStockOutOrderApplicationService {
|
|||||||
return stockOutOrderDomainService.issueOrder(stockOutOrderDO);
|
return stockOutOrderDomainService.issueOrder(stockOutOrderDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean executeAndIssue(ReservationStockOutOrderDO stockOutOrderDO){
|
||||||
|
return stockOutOrderDomainService.executeAndIssue(stockOutOrderDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+149
-24
@@ -20,6 +20,15 @@ import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder;
|
|||||||
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
|
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
|
||||||
import com.mhd.oms.domain.executeOrder.entity.ExecuteOrder;
|
import com.mhd.oms.domain.executeOrder.entity.ExecuteOrder;
|
||||||
import com.mhd.oms.domain.executeOrder.repository.mapper.ExecuteOrderMapper;
|
import com.mhd.oms.domain.executeOrder.repository.mapper.ExecuteOrderMapper;
|
||||||
|
import com.mhd.oms.domain.executionInMaterialDetail.entity.ExecutionInMaterialDetail;
|
||||||
|
import com.mhd.oms.domain.executionInMaterialDetail.repository.facade.IExecutionInMaterialDetailService;
|
||||||
|
import com.mhd.oms.domain.executionOutMaterialDetail.entity.ExecutionOutMaterialDetail;
|
||||||
|
import com.mhd.oms.domain.executionOutMaterialDetail.repository.facade.IExecutionOutMaterialDetailService;
|
||||||
|
import com.mhd.oms.domain.executionStockInOrder.entity.ExecutionStockInOrder;
|
||||||
|
import com.mhd.oms.domain.executionStockOutOrder.entity.ExecutionStockOutOrder;
|
||||||
|
import com.mhd.oms.domain.executionStockOutOrder.repository.facade.IExecutionStockOutOrderService;
|
||||||
|
import com.mhd.oms.domain.executionStockOutOrder.repository.todo.ExecutionStockOutOrderDO;
|
||||||
|
import com.mhd.oms.domain.executionStockOutOrder.service.ExecutionStockOutOrderApplicationService;
|
||||||
import com.mhd.oms.domain.reservationDeliveryDetailsLink.entity.ReservationDeliveryDetailsLink;
|
import com.mhd.oms.domain.reservationDeliveryDetailsLink.entity.ReservationDeliveryDetailsLink;
|
||||||
import com.mhd.oms.domain.reservationDeliveryDetailsLink.repository.facade.IReservationDeliveryDetailsLinkService;
|
import com.mhd.oms.domain.reservationDeliveryDetailsLink.repository.facade.IReservationDeliveryDetailsLinkService;
|
||||||
import com.mhd.oms.domain.reservationInMaterialDetail.entity.ReservationInMaterialDetail;
|
import com.mhd.oms.domain.reservationInMaterialDetail.entity.ReservationInMaterialDetail;
|
||||||
@@ -71,6 +80,10 @@ public class ReservationStockOutOrderDomainService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IReservationOutMaterialDetailService outMaterialDetailService;
|
private IReservationOutMaterialDetailService outMaterialDetailService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private IExecutionStockOutOrderService executionStockOutOrderService;
|
||||||
|
@Autowired
|
||||||
|
private IExecutionOutMaterialDetailService executionOutMaterialDetailService;
|
||||||
|
@Autowired
|
||||||
private IReservationDeliveryDetailsLinkService deliveryDetailsLinkService;
|
private IReservationDeliveryDetailsLinkService deliveryDetailsLinkService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IReservationStockInOrderService reservationStockInOrderService;
|
private IReservationStockInOrderService reservationStockInOrderService;
|
||||||
@@ -80,7 +93,8 @@ public class ReservationStockOutOrderDomainService {
|
|||||||
private BusinessDocumentOrderMapper businessDocumentOrderMapper;
|
private BusinessDocumentOrderMapper businessDocumentOrderMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ExecuteOrderMapper executeOrderMapper;
|
private ExecuteOrderMapper executeOrderMapper;
|
||||||
|
@Autowired
|
||||||
|
private ExecutionStockOutOrderApplicationService stockOutOrderApplicationService;
|
||||||
@Resource
|
@Resource
|
||||||
private SystemServiceFeign systemServiceFeign;
|
private SystemServiceFeign systemServiceFeign;
|
||||||
@Resource
|
@Resource
|
||||||
@@ -331,32 +345,143 @@ public class ReservationStockOutOrderDomainService {
|
|||||||
|
|
||||||
//todo下发推送到wms
|
//todo下发推送到wms
|
||||||
List<Long> inOrderIds = stockOutOrderDO.getOutOrderIds();
|
List<Long> inOrderIds = stockOutOrderDO.getOutOrderIds();
|
||||||
|
|
||||||
for (Long inOrderId : inOrderIds) {
|
for (Long inOrderId : inOrderIds) {
|
||||||
ReservationStockOutOrder byId = stockOutOrderService.getById(inOrderId);
|
ReservationStockOutOrder byId = stockOutOrderService.getById(inOrderId);
|
||||||
StockOutOrder stockOutOrder = new StockOutOrder();
|
String inOrderNumber = byId.getOutOrderNumber();
|
||||||
BeanUtils.copyProperties(byId, stockOutOrder,"outOrderId");
|
|
||||||
wmsServiceFeign.omsOutOrderAdd(stockOutOrder);
|
|
||||||
|
|
||||||
List<ReservationDeliveryDetailsLink> list = deliveryDetailsLinkService.list(new QueryWrapper<ReservationDeliveryDetailsLink>().lambda().eq(ReservationDeliveryDetailsLink::getOrderNumber, byId.getOutOrderNumber()));
|
|
||||||
List<DeliveryDetailsLink> deliveryDetailsLinkList = new ArrayList<>();
|
|
||||||
for (ReservationDeliveryDetailsLink reservationDeliveryDetailsLink : list) {
|
|
||||||
DeliveryDetailsLink deliveryDetailsLink = new DeliveryDetailsLink();
|
|
||||||
BeanUtils.copyProperties(reservationDeliveryDetailsLink, deliveryDetailsLink,"id");
|
|
||||||
deliveryDetailsLink.setOmsId(reservationDeliveryDetailsLink.getId());
|
|
||||||
deliveryDetailsLinkList.add(deliveryDetailsLink);
|
|
||||||
}
|
|
||||||
wmsServiceFeign.omsOutOrderAddDeliveryDetailsLink(deliveryDetailsLinkList);
|
|
||||||
|
|
||||||
|
|
||||||
String inOrderNumber = stockOutOrder.getOutOrderNumber();
|
|
||||||
List<ReservationOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReservationOutMaterialDetail>().lambda().eq(ReservationOutMaterialDetail::getOutOrderNumber, inOrderNumber));
|
List<ReservationOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReservationOutMaterialDetail>().lambda().eq(ReservationOutMaterialDetail::getOutOrderNumber, inOrderNumber));
|
||||||
List<OutMaterialDetail> outMaterialDetailList = new ArrayList<>();
|
|
||||||
for (ReservationOutMaterialDetail reservationOutMaterialDetail : materialDetailList) {
|
// 按照 warehouseId 分组
|
||||||
OutMaterialDetail outMaterialDetail = new OutMaterialDetail();
|
Map<Long, List<ReservationOutMaterialDetail>> materialDetailGroupByWarehouse = materialDetailList.stream()
|
||||||
BeanUtils.copyProperties(reservationOutMaterialDetail, outMaterialDetail,"materialDetailId");
|
.collect(Collectors.groupingBy(ReservationOutMaterialDetail::getWarehouseId));
|
||||||
outMaterialDetailList.add(outMaterialDetail);
|
materialDetailGroupByWarehouse.forEach((warehouseId, details) -> {
|
||||||
}
|
Long topOrgId = reservationStockInOrderMapper.getTopOrgId(warehouseId);
|
||||||
wmsServiceFeign.omsOutOrderAddDetail(outMaterialDetailList);
|
Long orgId = reservationStockInOrderMapper.getOrgId(warehouseId);
|
||||||
|
String orgName = reservationStockInOrderMapper.getOrgName(warehouseId);
|
||||||
|
String warehouseCode = reservationStockInOrderMapper.getWarehouseCode(warehouseId);
|
||||||
|
String warehouseName = reservationStockInOrderMapper.getWarehouseName(warehouseId);
|
||||||
|
|
||||||
|
ExecutionStockOutOrder reservationStockInOrder = new ExecutionStockOutOrder();
|
||||||
|
BeanUtils.copyProperties(byId, reservationStockInOrder,"outOrderId","issueStatus","issueTime","issueId","issueName","reservationAuditId","reservationAuditName","reservationAuditTime");
|
||||||
|
reservationStockInOrder.setIssueStatus(0);
|
||||||
|
reservationStockInOrder.setOrderTypeCode("pu_tong_chu_ku");
|
||||||
|
reservationStockInOrder.setOrderTypeName("普通出库");
|
||||||
|
reservationStockInOrder.setReservationOrderSource("客户预约");
|
||||||
|
reservationStockInOrder.setWarehouseId(warehouseId);
|
||||||
|
reservationStockInOrder.setOrganizationId(orgId);
|
||||||
|
reservationStockInOrder.setOrganizationName(orgName);
|
||||||
|
reservationStockInOrder.setTopOrganizationId(topOrgId);
|
||||||
|
reservationStockInOrder.setWarehouseCode(warehouseCode);
|
||||||
|
reservationStockInOrder.setWarehouseName(warehouseName);
|
||||||
|
reservationStockInOrder.setBusinessOutOrderNumber(inOrderNumber);
|
||||||
|
if (materialDetailGroupByWarehouse!=null&&materialDetailGroupByWarehouse.size()>1) {
|
||||||
|
reservationStockInOrder.setOutOrderNumber(OrderSequence.getOrderCode("CK"));
|
||||||
|
} else {
|
||||||
|
reservationStockInOrder.setOutOrderNumber(inOrderNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ExecutionOutMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||||
|
for (ReservationOutMaterialDetail reservationOutMaterialDetail : details) {
|
||||||
|
ExecutionOutMaterialDetail reservationInMaterialDetail = new ExecutionOutMaterialDetail();
|
||||||
|
BeanUtils.copyProperties(reservationOutMaterialDetail, reservationInMaterialDetail,"materialDetailId");
|
||||||
|
reservationInMaterialDetail.setQuantity(reservationOutMaterialDetail.getQuantity());
|
||||||
|
reservationInMaterialDetail.setOrganizationId(orgId);
|
||||||
|
reservationInMaterialDetail.setOrganizationName(orgName);
|
||||||
|
reservationInMaterialDetail.setTopOrganizationId(topOrgId);
|
||||||
|
reservationInMaterialDetail.setWarehouseCode(warehouseCode);
|
||||||
|
reservationInMaterialDetail.setWarehouseName(warehouseName);
|
||||||
|
reservationInMaterialDetail.setOutOrderNumber(reservationStockInOrder.getOutOrderNumber());
|
||||||
|
inMaterialDetailList.add(reservationInMaterialDetail);
|
||||||
|
}
|
||||||
|
BigDecimal quantity = details.stream().map(ReservationOutMaterialDetail::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
reservationStockInOrder.setQuantity(quantity);
|
||||||
|
executionStockOutOrderService.save(reservationStockInOrder);
|
||||||
|
executionOutMaterialDetailService.saveBatch(inMaterialDetailList);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return update;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean executeAndIssue(ReservationStockOutOrderDO stockOutOrderDO) {
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
// 获取用户姓名(优先从UserPo获取,如果为空则使用realname,最后使用username作为兜底)
|
||||||
|
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
|
||||||
|
? loginUser.getUserPo().getUserName()
|
||||||
|
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
|
||||||
|
boolean update = stockOutOrderService.update(null, new UpdateWrapper<ReservationStockOutOrder>().lambda()
|
||||||
|
.set(ReservationStockOutOrder::getIssueId, loginUser.getUserid())
|
||||||
|
.set(ReservationStockOutOrder::getIssueName, userRealName)
|
||||||
|
.set(ReservationStockOutOrder::getIssueTime, new Date())
|
||||||
|
//.set(ReservationStockOutOrder::getIssueStatus, 1)
|
||||||
|
.set(ReservationStockOutOrder::getUpdateBy, loginUser.getUserid())
|
||||||
|
.set(ReservationStockOutOrder::getUpdateByName, userRealName)
|
||||||
|
.set(ReservationStockOutOrder::getUpdateTime, new Date())
|
||||||
|
.in(ReservationStockOutOrder::getOutOrderId, stockOutOrderDO.getOutOrderIds()));
|
||||||
|
|
||||||
|
//todo下发推送到wms
|
||||||
|
List<Long> inOrderIds = stockOutOrderDO.getOutOrderIds();
|
||||||
|
|
||||||
|
for (Long inOrderId : inOrderIds) {
|
||||||
|
ReservationStockOutOrder byId = stockOutOrderService.getById(inOrderId);
|
||||||
|
String inOrderNumber = byId.getOutOrderNumber();
|
||||||
|
List<ReservationOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReservationOutMaterialDetail>().lambda().eq(ReservationOutMaterialDetail::getOutOrderNumber, inOrderNumber));
|
||||||
|
|
||||||
|
// 按照 warehouseId 分组
|
||||||
|
Map<Long, List<ReservationOutMaterialDetail>> materialDetailGroupByWarehouse = materialDetailList.stream()
|
||||||
|
.collect(Collectors.groupingBy(ReservationOutMaterialDetail::getWarehouseId));
|
||||||
|
materialDetailGroupByWarehouse.forEach((warehouseId, details) -> {
|
||||||
|
Long topOrgId = reservationStockInOrderMapper.getTopOrgId(warehouseId);
|
||||||
|
Long orgId = reservationStockInOrderMapper.getOrgId(warehouseId);
|
||||||
|
String orgName = reservationStockInOrderMapper.getOrgName(warehouseId);
|
||||||
|
String warehouseCode = reservationStockInOrderMapper.getWarehouseCode(warehouseId);
|
||||||
|
String warehouseName = reservationStockInOrderMapper.getWarehouseName(warehouseId);
|
||||||
|
|
||||||
|
ExecutionStockOutOrder reservationStockInOrder = new ExecutionStockOutOrder();
|
||||||
|
BeanUtils.copyProperties(byId, reservationStockInOrder,"outOrderId","issueStatus","issueTime","issueId","issueName","reservationAuditId","reservationAuditName","reservationAuditTime");
|
||||||
|
reservationStockInOrder.setIssueStatus(0);
|
||||||
|
reservationStockInOrder.setOrderTypeCode("pu_tong_chu_ku");
|
||||||
|
reservationStockInOrder.setOrderTypeName("普通出库");
|
||||||
|
reservationStockInOrder.setReservationOrderSource("客户预约");
|
||||||
|
reservationStockInOrder.setWarehouseId(warehouseId);
|
||||||
|
reservationStockInOrder.setOrganizationId(orgId);
|
||||||
|
reservationStockInOrder.setOrganizationName(orgName);
|
||||||
|
reservationStockInOrder.setTopOrganizationId(topOrgId);
|
||||||
|
reservationStockInOrder.setWarehouseCode(warehouseCode);
|
||||||
|
reservationStockInOrder.setWarehouseName(warehouseName);
|
||||||
|
reservationStockInOrder.setBusinessOutOrderNumber(inOrderNumber);
|
||||||
|
if (materialDetailGroupByWarehouse!=null&&materialDetailGroupByWarehouse.size()>1) {
|
||||||
|
reservationStockInOrder.setOutOrderNumber(OrderSequence.getOrderCode("CK"));
|
||||||
|
} else {
|
||||||
|
reservationStockInOrder.setOutOrderNumber(inOrderNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ExecutionOutMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||||
|
for (ReservationOutMaterialDetail reservationOutMaterialDetail : details) {
|
||||||
|
ExecutionOutMaterialDetail reservationInMaterialDetail = new ExecutionOutMaterialDetail();
|
||||||
|
BeanUtils.copyProperties(reservationOutMaterialDetail, reservationInMaterialDetail,"materialDetailId");
|
||||||
|
reservationInMaterialDetail.setQuantity(reservationOutMaterialDetail.getQuantity());
|
||||||
|
reservationInMaterialDetail.setOrganizationId(orgId);
|
||||||
|
reservationInMaterialDetail.setOrganizationName(orgName);
|
||||||
|
reservationInMaterialDetail.setTopOrganizationId(topOrgId);
|
||||||
|
reservationInMaterialDetail.setWarehouseCode(warehouseCode);
|
||||||
|
reservationInMaterialDetail.setWarehouseName(warehouseName);
|
||||||
|
reservationInMaterialDetail.setOutOrderNumber(reservationStockInOrder.getOutOrderNumber());
|
||||||
|
inMaterialDetailList.add(reservationInMaterialDetail);
|
||||||
|
}
|
||||||
|
BigDecimal quantity = details.stream().map(ReservationOutMaterialDetail::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
reservationStockInOrder.setQuantity(quantity);
|
||||||
|
executionStockOutOrderService.save(reservationStockInOrder);
|
||||||
|
executionOutMaterialDetailService.saveBatch(inMaterialDetailList);
|
||||||
|
|
||||||
|
//下发
|
||||||
|
Long outOrderId = reservationStockInOrder.getOutOrderId();
|
||||||
|
ExecutionStockOutOrderDO param = new ExecutionStockOutOrderDO();
|
||||||
|
List<Long> ids = new ArrayList<>();
|
||||||
|
ids.add(outOrderId);
|
||||||
|
param.setOutOrderIds(ids);
|
||||||
|
stockOutOrderApplicationService.issueOrder(param);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return update;
|
return update;
|
||||||
}
|
}
|
||||||
|
|||||||
+7
@@ -150,6 +150,13 @@ public class ReservationStockOutOrderApi extends BaseController {
|
|||||||
return AjaxResult.success(stockOutOrderApplicationService.issueOrder(stockOutOrderDO));
|
return AjaxResult.success(stockOutOrderApplicationService.issueOrder(stockOutOrderDO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("下发出库单")
|
||||||
|
@PostMapping(value = "/executeAndIssue")
|
||||||
|
public AjaxResult executeAndIssue(@RequestBody ReservationStockOutOrderDTO stockOutOrderDTO) {
|
||||||
|
ReservationStockOutOrderDO stockOutOrderDO = stockOutOrderAssembler.toDO(stockOutOrderDTO);
|
||||||
|
return AjaxResult.success(stockOutOrderApplicationService.executeAndIssue(stockOutOrderDO));
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("关闭出库单")
|
@ApiOperation("关闭出库单")
|
||||||
@PostMapping("/close")
|
@PostMapping("/close")
|
||||||
public AjaxResult close(@RequestBody ReservationStockOutOrderDTO stockOutOrderDTO)
|
public AjaxResult close(@RequestBody ReservationStockOutOrderDTO stockOutOrderDTO)
|
||||||
|
|||||||
+10
@@ -129,6 +129,16 @@ public class ReservationStockInOrderApi extends BaseController {
|
|||||||
return AjaxResult.success(stockInOrderApplicationService.issueOrder(stockInOrderDO));
|
return AjaxResult.success(stockInOrderApplicationService.issueOrder(stockInOrderDO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下发入库单
|
||||||
|
*/
|
||||||
|
@ApiOperation("下发入库单")
|
||||||
|
@PostMapping(value = "/executeAndIssue")
|
||||||
|
public AjaxResult executeAndIssue(@RequestBody ReservationStockInOrderDTO stockInOrderDTO) {
|
||||||
|
ReservationStockInOrderDO stockInOrderDO = stockInOrderAssembler.toDO(stockInOrderDTO);
|
||||||
|
return AjaxResult.success(stockInOrderApplicationService.executeAndIssue(stockInOrderDO));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wms回传出入库结果
|
* wms回传出入库结果
|
||||||
|
|||||||
+12
@@ -637,4 +637,16 @@
|
|||||||
<update id="delWOrderDetail">
|
<update id="delWOrderDetail">
|
||||||
update "NGWL_TEST_WMS".IN_MATERIAL_DETAIL set DEL_FLAG = 2 where DEL_FLAG = 1 and in_order_number = #{inOrderNumber}
|
update "NGWL_TEST_WMS".IN_MATERIAL_DETAIL set DEL_FLAG = 2 where DEL_FLAG = 1 and in_order_number = #{inOrderNumber}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="delWShOrder">
|
||||||
|
update "NGWL_TEST_WMS".STOCK_RECEIPT_ORDER set DEL_FLAG = 2 where DEL_FLAG = 1 and in_order_number = #{inOrderNumber}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="getWShOrder" parameterType="java.lang.String" resultType="java.lang.String">
|
||||||
|
select RECEIPT_ORDER_NUMBER from "NGWL_TEST_WMS".STOCK_RECEIPT_ORDER where 1 = 1 and DEL_FLAG = 1 and IN_ORDER_NUMBER = #{inOrderNumber}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="delWShOrderDetail">
|
||||||
|
update "NGWL_TEST_WMS".RECEIPT_MATERIAL_DETAIL set DEL_FLAG = 2 where DEL_FLAG = 1 and RECEIPT_ORDER_NUMBER = #{receiptOrderNumber}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -348,7 +348,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<include refid="selectMaterialDetailPo"/>
|
<include refid="selectMaterialDetailPo"/>
|
||||||
<include refid="com.mhd.wms.domain.stockInOrder.repository.mapper.StockInOrderMapper.joinStockInOrderPo"/>
|
<include refid="com.mhd.wms.domain.stockInOrder.repository.mapper.StockInOrderMapper.joinStockInOrderPo"/>
|
||||||
from in_material_detail a
|
from in_material_detail a
|
||||||
LEFT JOIN stock_in_order b ON a.in_order_number = b.in_order_number
|
LEFT JOIN stock_in_order b ON a.in_order_number = b.in_order_number and a.DEL_FLAG = 1 and b.DEL_FLAG = 1
|
||||||
<where>
|
<where>
|
||||||
<include refid="joinMaterialDetailPoWhere"/>
|
<include refid="joinMaterialDetailPoWhere"/>
|
||||||
<include refid="joinStockInOrderPoWhere"/>
|
<include refid="joinStockInOrderPoWhere"/>
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<include refid="selectInOrderAbnormalPo"/>
|
<include refid="selectInOrderAbnormalPo"/>
|
||||||
<include refid="com.mhd.wms.domain.stockInOrder.repository.mapper.StockInOrderMapper.joinStockInOrderPo"/>
|
<include refid="com.mhd.wms.domain.stockInOrder.repository.mapper.StockInOrderMapper.joinStockInOrderPo"/>
|
||||||
from in_order_abnormal a
|
from in_order_abnormal a
|
||||||
LEFT JOIN stock_in_order b ON a.in_order_number = b.in_order_number
|
LEFT JOIN stock_in_order b ON a.in_order_number = b.in_order_number and a.DEL_FLAG = 1 and b.DEL_FLAG = 1
|
||||||
<where>
|
<where>
|
||||||
<include refid="selectInOrderAbnormalPo1"/>
|
<include refid="selectInOrderAbnormalPo1"/>
|
||||||
<include refid="com.mhd.wms.domain.stockInOrder.repository.mapper.StockInOrderMapper.joinStockInOrderPoWhere"/>
|
<include refid="com.mhd.wms.domain.stockInOrder.repository.mapper.StockInOrderMapper.joinStockInOrderPoWhere"/>
|
||||||
|
|||||||
+4
-4
@@ -67,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
FROM
|
FROM
|
||||||
receipt_material_detail rmd
|
receipt_material_detail rmd
|
||||||
LEFT JOIN stock_receipt_order sro1 ON sro1.receipt_order_number = rmd.receipt_order_number
|
LEFT JOIN stock_receipt_order sro1 ON sro1.receipt_order_number = rmd.receipt_order_number
|
||||||
LEFT JOIN stock_in_order sio1 ON sro1.in_order_number = sio1.in_order_number
|
LEFT JOIN stock_in_order sio1 ON sro1.in_order_number = sio1.in_order_number and sio1.DEL_FLAG = 1 and sro1.DEL_FLAG = 1
|
||||||
WHERE
|
WHERE
|
||||||
rmd.receipt_status IN ( 1, 2 )
|
rmd.receipt_status IN ( 1, 2 )
|
||||||
AND rmd.receipt_quantity > 0
|
AND rmd.receipt_quantity > 0
|
||||||
@@ -95,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
FROM
|
FROM
|
||||||
shelf_material_detail smd
|
shelf_material_detail smd
|
||||||
LEFT JOIN stock_shelf_order sso ON sso.shelf_order_number = smd.shelf_order_number
|
LEFT JOIN stock_shelf_order sso ON sso.shelf_order_number = smd.shelf_order_number
|
||||||
LEFT JOIN stock_in_order sio2 ON sso.in_order_number = sio2.in_order_number
|
LEFT JOIN stock_in_order sio2 ON sso.in_order_number = sio2.in_order_number and sio1.DEL_FLAG = 1 and sso1.DEL_FLAG = 1
|
||||||
WHERE
|
WHERE
|
||||||
smd.shelves_status IN ( 1, 2 )
|
smd.shelves_status IN ( 1, 2 )
|
||||||
GROUP BY
|
GROUP BY
|
||||||
@@ -220,7 +220,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
FROM
|
FROM
|
||||||
receipt_material_detail rmd
|
receipt_material_detail rmd
|
||||||
LEFT JOIN stock_receipt_order sro ON sro.receipt_order_number = rmd.receipt_order_number
|
LEFT JOIN stock_receipt_order sro ON sro.receipt_order_number = rmd.receipt_order_number
|
||||||
LEFT JOIN stock_in_order sio ON sro.in_order_number = sio.in_order_number
|
LEFT JOIN stock_in_order sio ON sro.in_order_number = sio.in_order_number and sio1.DEL_FLAG = 1 and sro1.DEL_FLAG = 1
|
||||||
WHERE
|
WHERE
|
||||||
sro.status IN ( 1, 2 )
|
sro.status IN ( 1, 2 )
|
||||||
<include refid="whereForGetInfo"/>
|
<include refid="whereForGetInfo"/>
|
||||||
@@ -248,7 +248,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
FROM
|
FROM
|
||||||
shelf_material_detail rmd
|
shelf_material_detail rmd
|
||||||
LEFT JOIN stock_shelf_order sso ON sso.shelf_order_number = rmd.shelf_order_number
|
LEFT JOIN stock_shelf_order sso ON sso.shelf_order_number = rmd.shelf_order_number
|
||||||
LEFT JOIN stock_in_order sio ON sso.in_order_number = sio.in_order_number
|
LEFT JOIN stock_in_order sio ON sso.in_order_number = sio.in_order_number and sio1.DEL_FLAG = 1 and sso1.DEL_FLAG = 1
|
||||||
WHERE
|
WHERE
|
||||||
sso.STATUS IN (
|
sso.STATUS IN (
|
||||||
1,
|
1,
|
||||||
|
|||||||
@@ -775,7 +775,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
receipt_material_detail c
|
receipt_material_detail c
|
||||||
LEFT JOIN stock_receipt_order d ON c.receipt_order_number = d.receipt_order_number
|
LEFT JOIN stock_receipt_order d ON c.receipt_order_number = d.receipt_order_number
|
||||||
AND d.del_flag = 1
|
AND d.del_flag = 1
|
||||||
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number
|
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number and e.DEL_FLAG = 1 and d.DEL_FLAG = 1
|
||||||
WHERE
|
WHERE
|
||||||
c.del_flag = 1 and d.STATUS = 3
|
c.del_flag = 1 and d.STATUS = 3
|
||||||
AND e.warehouse_id = a.warehouse_id
|
AND e.warehouse_id = a.warehouse_id
|
||||||
@@ -802,7 +802,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
shelf_material_detail c
|
shelf_material_detail c
|
||||||
LEFT JOIN stock_shelf_order d ON c.shelf_order_number = d.shelf_order_number
|
LEFT JOIN stock_shelf_order d ON c.shelf_order_number = d.shelf_order_number
|
||||||
AND d.del_flag = 1
|
AND d.del_flag = 1
|
||||||
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number
|
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number and e.DEL_FLAG = 1 and d.DEL_FLAG = 1
|
||||||
WHERE
|
WHERE
|
||||||
c.del_flag = 1 and d.STATUS = 1
|
c.del_flag = 1 and d.STATUS = 1
|
||||||
AND e.warehouse_id = a.warehouse_id
|
AND e.warehouse_id = a.warehouse_id
|
||||||
@@ -983,7 +983,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
receipt_material_detail c
|
receipt_material_detail c
|
||||||
LEFT JOIN stock_receipt_order d ON c.receipt_order_number = d.receipt_order_number
|
LEFT JOIN stock_receipt_order d ON c.receipt_order_number = d.receipt_order_number
|
||||||
AND d.del_flag = 1
|
AND d.del_flag = 1
|
||||||
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number
|
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number and e.DEL_FLAG = 1 and d.DEL_FLAG = 1
|
||||||
WHERE
|
WHERE
|
||||||
c.del_flag = 1 and d.STATUS = 3
|
c.del_flag = 1 and d.STATUS = 3
|
||||||
AND e.warehouse_id = a.warehouse_id
|
AND e.warehouse_id = a.warehouse_id
|
||||||
@@ -1013,7 +1013,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
receipt_material_detail c
|
receipt_material_detail c
|
||||||
LEFT JOIN stock_receipt_order d ON c.receipt_order_number = d.receipt_order_number
|
LEFT JOIN stock_receipt_order d ON c.receipt_order_number = d.receipt_order_number
|
||||||
AND d.del_flag = 1
|
AND d.del_flag = 1
|
||||||
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number
|
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number and e.DEL_FLAG = 1 and d.DEL_FLAG = 1
|
||||||
WHERE
|
WHERE
|
||||||
c.del_flag = 1 and d.STATUS = 3
|
c.del_flag = 1 and d.STATUS = 3
|
||||||
AND e.warehouse_id = a.warehouse_id
|
AND e.warehouse_id = a.warehouse_id
|
||||||
@@ -1043,7 +1043,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
shelf_material_detail c
|
shelf_material_detail c
|
||||||
LEFT JOIN stock_shelf_order d ON c.shelf_order_number = d.shelf_order_number
|
LEFT JOIN stock_shelf_order d ON c.shelf_order_number = d.shelf_order_number
|
||||||
AND d.del_flag = 1
|
AND d.del_flag = 1
|
||||||
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number
|
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number and e.DEL_FLAG = 1 and d.DEL_FLAG = 1
|
||||||
WHERE
|
WHERE
|
||||||
c.del_flag = 1
|
c.del_flag = 1
|
||||||
AND e.warehouse_id = a.warehouse_id
|
AND e.warehouse_id = a.warehouse_id
|
||||||
@@ -1063,7 +1063,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
shelf_material_detail c
|
shelf_material_detail c
|
||||||
LEFT JOIN stock_shelf_order d ON c.shelf_order_number = d.shelf_order_number
|
LEFT JOIN stock_shelf_order d ON c.shelf_order_number = d.shelf_order_number
|
||||||
AND d.del_flag = 1
|
AND d.del_flag = 1
|
||||||
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number
|
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number and e.DEL_FLAG = 1 and d.DEL_FLAG = 1
|
||||||
WHERE
|
WHERE
|
||||||
c.del_flag = 1
|
c.del_flag = 1
|
||||||
AND e.warehouse_id = a.warehouse_id
|
AND e.warehouse_id = a.warehouse_id
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<include refid="selectStockReceiptOrderPo"/>
|
<include refid="selectStockReceiptOrderPo"/>
|
||||||
<include refid="com.mhd.wms.domain.stockInOrder.repository.mapper.StockInOrderMapper.joinStockInOrderPo"/>
|
<include refid="com.mhd.wms.domain.stockInOrder.repository.mapper.StockInOrderMapper.joinStockInOrderPo"/>
|
||||||
from stock_receipt_order a
|
from stock_receipt_order a
|
||||||
LEFT JOIN stock_in_order b ON a.in_order_number = b.in_order_number
|
LEFT JOIN stock_in_order b ON a.in_order_number = b.in_order_number and a.DEL_FLAG = 1 and b.DEL_FLAG = 1
|
||||||
<where>
|
<where>
|
||||||
<include refid="selectStockReceiptOrderPo1"/>
|
<include refid="selectStockReceiptOrderPo1"/>
|
||||||
<include refid="com.mhd.wms.domain.stockInOrder.repository.mapper.StockInOrderMapper.joinStockInOrderPoWhere"/>
|
<include refid="com.mhd.wms.domain.stockInOrder.repository.mapper.StockInOrderMapper.joinStockInOrderPoWhere"/>
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<include refid="selectStockShelfOrderPo"/>
|
<include refid="selectStockShelfOrderPo"/>
|
||||||
<include refid="com.mhd.wms.domain.stockInOrder.repository.mapper.StockInOrderMapper.joinStockInOrderPo"/>
|
<include refid="com.mhd.wms.domain.stockInOrder.repository.mapper.StockInOrderMapper.joinStockInOrderPo"/>
|
||||||
from stock_shelf_order a
|
from stock_shelf_order a
|
||||||
LEFT JOIN stock_in_order b ON a.in_order_number = b.in_order_number
|
LEFT JOIN stock_in_order b ON a.in_order_number = b.in_order_number and a.DEL_FLAG = 1 and b.DEL_FLAG = 1
|
||||||
<where>
|
<where>
|
||||||
<include refid="selectStockShelfOrderPo1"/>
|
<include refid="selectStockShelfOrderPo1"/>
|
||||||
<include refid="com.mhd.wms.domain.stockInOrder.repository.mapper.StockInOrderMapper.joinStockInOrderPoWhere"/>
|
<include refid="com.mhd.wms.domain.stockInOrder.repository.mapper.StockInOrderMapper.joinStockInOrderPoWhere"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user