bms改造;
This commit is contained in:
+16
-1
@@ -23,6 +23,8 @@ import com.mhd.wms.domain.handoverTaskOrder.repository.facade.IHandoverTaskOrder
|
||||
import com.mhd.wms.domain.handoverTaskOrder.repository.po.HandoverTaskOrderPO;
|
||||
import com.mhd.wms.domain.handoverTaskOrder.repository.todo.HandoverTaskOrderDO;
|
||||
import com.mhd.wms.domain.handoverTaskOrder.service.HandoverTaskOrderDomainService;
|
||||
import com.mhd.wms.application.service.materialInventory.MaterialInventoryApplicationService;
|
||||
import com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryParamDO;
|
||||
import com.mhd.wms.domain.shiftManage.repository.todo.ShiftManageDO;
|
||||
import com.mhd.wms.domain.stockOutOrder.entity.StockOutOrder;
|
||||
import com.mhd.wms.domain.stockOutOrder.repository.facade.IStockOutOrderService;
|
||||
@@ -33,6 +35,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -58,6 +61,9 @@ public class HandoverTaskOrderApplicationService {
|
||||
@Autowired
|
||||
private IStockOutOrderService stockOutOrderService;
|
||||
|
||||
@Autowired
|
||||
private MaterialInventoryApplicationService materialInventoryApplicationService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询交接作业单列表
|
||||
@@ -200,7 +206,12 @@ public class HandoverTaskOrderApplicationService {
|
||||
* @return Boolean
|
||||
*/
|
||||
public Boolean completeHandover(HandoverTaskOrderDO handoverTaskOrderDO){
|
||||
return handoverTaskOrderDomainService.completeHandover(handoverTaskOrderDO);
|
||||
Boolean result = handoverTaskOrderDomainService.completeHandover(handoverTaskOrderDO);
|
||||
List<MaterialInventoryParamDO> clearoutParamDOs = handoverTaskOrderDomainService.getLastClearoutParamDOs();
|
||||
for (MaterialInventoryParamDO paramDO : clearoutParamDOs) {
|
||||
materialInventoryApplicationService.pushBillingRecordClearout(paramDO.getMaterialInventoryId(), paramDO.getQuantity());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -297,6 +308,10 @@ public class HandoverTaskOrderApplicationService {
|
||||
completeDO.setHandoverTaskOrderIds(handoverTaskOrderIds.stream().map(String::valueOf).collect(Collectors.toList()));
|
||||
completeDO.setBillingJson(handoverTaskOrderDO.getBillingJson());
|
||||
handoverTaskOrderDomainService.completeHandover(completeDO);
|
||||
List<MaterialInventoryParamDO> clearoutParamDOs = handoverTaskOrderDomainService.getLastClearoutParamDOs();
|
||||
for (MaterialInventoryParamDO paramDO : clearoutParamDOs) {
|
||||
materialInventoryApplicationService.pushBillingRecordClearout(paramDO.getMaterialInventoryId(), paramDO.getQuantity());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+226
-21
@@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.utils.OrderSequence;
|
||||
import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.common.core.utils.StringUtils;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
@@ -18,6 +19,7 @@ import com.mhd.system.api.domain.cache.SystemServiceCacheUtil;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import com.mhd.wms.domain.materialBaseInfo.entity.MaterialBaseInfo;
|
||||
import com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper;
|
||||
import com.mhd.wms.domain.materialInventory.entity.MaterialInventory;
|
||||
import com.mhd.wms.domain.materialInventory.repository.mapper.MaterialInventoryMapper;
|
||||
import com.mhd.wms.domain.materialInventory.repository.po.MaterialInventoryPO;
|
||||
import com.mhd.wms.domain.materialInventory.repository.po.MaterialInventoryQueryListPO;
|
||||
@@ -33,6 +35,7 @@ import com.mhd.wms.domain.outMaterialDetail.repository.mapper.OutMaterialDetailM
|
||||
import com.mhd.wms.domain.stockOutOrder.repository.facade.IStockOutOrderService;
|
||||
import com.mhd.wms.domain.stockOutOrder.repository.po.StockOutOrderPO;
|
||||
import com.mhd.wms.util.BatchNoTokenUtil;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -43,6 +46,7 @@ import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -886,16 +890,36 @@ public class MaterialInventoryApplicationService {
|
||||
}
|
||||
}
|
||||
|
||||
public void pushBillingRecord(String shipperId) {
|
||||
//非首次推送
|
||||
List<MaterialInventoryPO> materialInventoryPOS = materialInventoryDomainService.queryPushBms(shipperId);
|
||||
if (materialInventoryPOS==null || materialInventoryPOS.size()==0) return;
|
||||
for (MaterialInventoryPO materialInventoryPO : materialInventoryPOS) {
|
||||
Date createTime = materialInventoryPO.getCreateTime();
|
||||
Long materialBaseInfoId = materialInventoryPO.getMaterialBaseInfoId();
|
||||
String lotNumber = materialInventoryPO.getLotNumber();
|
||||
String inOrderNumber = materialInventoryPO.getInOrderNumber();
|
||||
//推送清仓计费记录
|
||||
public void pushBillingRecordClearout(Long materialInventoryId,BigDecimal quantity) {
|
||||
|
||||
MaterialInventory materialInventory = materialInventoryMapper.selectById(materialInventoryId);
|
||||
MaterialInventoryPO materialInventoryPO = new MaterialInventoryPO();
|
||||
BeanUtils.copyProperties(materialInventory, materialInventoryPO);
|
||||
//未查询到库存记录
|
||||
Long shipperId = materialInventoryPO.getShipperId();
|
||||
Date createTime = materialInventoryPO.getCreateTime();
|
||||
Long materialBaseInfoId = materialInventoryPO.getMaterialBaseInfoId();
|
||||
String lotNumber = materialInventoryPO.getLotNumber();
|
||||
String inOrderNumber = materialInventoryPO.getInOrderNumber();
|
||||
Long warehouseId = materialInventoryPO.getWarehouseId();
|
||||
Date lastBillingTime = materialInventoryPO.getLastBillingTime();
|
||||
if (warehouseId==19) {//干仓计费
|
||||
Map<String,Object> shipperParameters = materialInventoryDomainService.queryShipperParameters(shipperId,"干仓计费配置");
|
||||
//客户未配置干仓计费配置
|
||||
if (shipperParameters == null || shipperParameters.size()==0) return;
|
||||
Long contractManageId = (Long) shipperParameters.get("contractManageId");
|
||||
Long settlementCustomersId = (Long) shipperParameters.get("settlementCustomersId");
|
||||
String contractNumber = (String) shipperParameters.get("contractNumber");
|
||||
String content = (String) shipperParameters.get("content");
|
||||
Map<String, Object> contentMap = content != null ? JSON.parseObject(content, Map.class) : new HashMap<>();
|
||||
Integer sfzdcz = (Integer) contentMap.get("sfzdcz");
|
||||
//客户未配置或是否自动推送设置为否
|
||||
if (sfzdcz==null) return;
|
||||
if (sfzdcz!=1) return;
|
||||
//计算费用
|
||||
List<Map<String, Object>> monthFee = materialInventoryDomainService.getMonthFee(inOrderNumber, materialBaseInfoId,lotNumber);
|
||||
//入库业务单未设置每月仓租
|
||||
if (monthFee == null || monthFee.size()==0) return;
|
||||
Map<String, Object> feeMap = monthFee.get(0);
|
||||
//半月仓租
|
||||
@@ -912,7 +936,7 @@ public class MaterialInventoryApplicationService {
|
||||
if (isYesterday) {
|
||||
//首次计费 需要夫力费
|
||||
//库存数量
|
||||
BigDecimal inventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
||||
BigDecimal inventoryQuantity = quantity;
|
||||
//仓租
|
||||
BigDecimal totalWarehouseRent = inventoryQuantity.multiply(monthlyWarehouseFee);
|
||||
//夫力费
|
||||
@@ -921,7 +945,9 @@ public class MaterialInventoryApplicationService {
|
||||
BigDecimal unitPrice = materialBaseInfo.getUnitPrice();
|
||||
//火险保费
|
||||
BigDecimal fireInsureFee = unitPrice.multiply(inventoryQuantity).multiply(new BigDecimal("0.0003"));
|
||||
|
||||
buildBusinessDocument(totalWarehouseRent, materialInventoryPO,"0D081","干仓仓租费用",contractManageId,"干仓");
|
||||
buildBusinessDocument(manpowerFee, materialInventoryPO,"0D082","夫力费",contractManageId,"干仓");
|
||||
buildBusinessDocument(fireInsureFee, materialInventoryPO,"0D083","火险保费",contractManageId,"干仓");
|
||||
|
||||
} else {
|
||||
//期间付费 不需要夫力费
|
||||
@@ -933,13 +959,188 @@ public class MaterialInventoryApplicationService {
|
||||
BigDecimal unitPrice = materialBaseInfo.getUnitPrice();
|
||||
//火险保费
|
||||
BigDecimal fireInsureFee = unitPrice.multiply(inventoryQuantity).multiply(new BigDecimal("0.0003"));
|
||||
buildBusinessDocument(totalWarehouseRent, materialInventoryPO,"0D081","干仓仓租费用",contractManageId,"冻仓");
|
||||
buildBusinessDocument(fireInsureFee, materialInventoryPO,"0D083","火险保费",contractManageId,"冻仓");
|
||||
}
|
||||
} else if (warehouseId==20) {//冻仓计费
|
||||
Map<String,Object> shipperParameters = materialInventoryDomainService.queryShipperParameters(Long.valueOf(shipperId),"冻仓计费配置");
|
||||
if (shipperParameters == null || shipperParameters.size()==0) return;
|
||||
Long contractManageId = (Long) shipperParameters.get("contractManageId");
|
||||
Long settlementCustomersId = (Long) shipperParameters.get("settlementCustomersId");
|
||||
String contractNumber = (String) shipperParameters.get("contractNumber");
|
||||
String content = (String) shipperParameters.get("content");
|
||||
Map<String, Object> contentMap = content != null ? JSON.parseObject(content, Map.class) : new HashMap<>();
|
||||
Integer sfzdcz = (Integer) contentMap.get("sfzdcz");
|
||||
//客户未配置或是否自动推送设置为否
|
||||
if (sfzdcz==null) return;
|
||||
if (sfzdcz!=1) return;
|
||||
//计算费用
|
||||
MaterialBaseInfo materialBaseInfo = materialBaseInfoMapper.selectById(materialBaseInfoId);
|
||||
BigDecimal unitPrice = materialBaseInfo.getUnitPrice();
|
||||
String materialClassifyId = materialBaseInfo.getMaterialClassifyId();
|
||||
BigDecimal weightLimit = materialBaseInfo.getWeightLimit();
|
||||
Map<String,Object> materialClassify = materialInventoryDomainService.queryMaterialClassify(Long.valueOf(materialClassifyId));
|
||||
//物料分类不存在
|
||||
if (materialClassify == null || materialClassify.size()==0) return;
|
||||
BigDecimal monthlyWarehouseRent = (BigDecimal) materialClassify.get("monthlyWarehouseRent");
|
||||
BigDecimal halfMonthWarehouseRent = (BigDecimal) materialClassify.get("halfMonthWarehouseRent");
|
||||
String monthlyWarehouseRentUnit = (String) materialClassify.get("monthlyWarehouseRentUnit");
|
||||
String halfMonthWarehouseRentUnit = (String) materialClassify.get("halfMonthWarehouseRentUnit");
|
||||
//半月仓租
|
||||
BigDecimal halfMonthWhFee = halfMonthWarehouseRent;
|
||||
//整月仓租
|
||||
BigDecimal monthlyWarehouseFee = monthlyWarehouseRent;
|
||||
long daysDiff = 0;
|
||||
if (lastBillingTime != null) {
|
||||
LocalDate lastBillingDate = lastBillingTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
daysDiff = ChronoUnit.DAYS.between(lastBillingDate, LocalDate.now());
|
||||
} else {
|
||||
daysDiff = -1;
|
||||
}
|
||||
BigDecimal inventoryQuantity = quantity;
|
||||
if (daysDiff < 15) {
|
||||
// 不足半月: 收半月仓租
|
||||
BigDecimal totalWarehouseRent = inventoryQuantity.multiply(halfMonthWhFee).multiply(weightLimit);
|
||||
buildBusinessDocument(totalWarehouseRent, materialInventoryPO,"0D081","冻仓仓租费用",contractManageId,"冻仓");
|
||||
} else {
|
||||
// 大于等于半月: 收整月仓租
|
||||
BigDecimal totalWarehouseRent = inventoryQuantity.multiply(monthlyWarehouseFee).multiply(weightLimit);
|
||||
buildBusinessDocument(totalWarehouseRent, materialInventoryPO,"0D081","冻仓仓租费用",contractManageId,"冻仓");
|
||||
}
|
||||
//更新最后计费时间
|
||||
Long id = materialInventoryPO.getMaterialInventoryId();
|
||||
MaterialInventory Inventory = materialInventoryMapper.selectById(id);
|
||||
Inventory.setLastBillingTime(new Date());
|
||||
materialInventoryMapper.updateById(Inventory);
|
||||
}
|
||||
}
|
||||
|
||||
public void pushBillingRecord(String shipperId) {
|
||||
|
||||
List<MaterialInventoryPO> materialInventoryPOS = materialInventoryDomainService.queryPushBms(shipperId);
|
||||
//未查询到库存记录
|
||||
if (materialInventoryPOS==null || materialInventoryPOS.size()==0) return;
|
||||
for (MaterialInventoryPO materialInventoryPO : materialInventoryPOS) {
|
||||
Date createTime = materialInventoryPO.getCreateTime();
|
||||
Long materialBaseInfoId = materialInventoryPO.getMaterialBaseInfoId();
|
||||
String lotNumber = materialInventoryPO.getLotNumber();
|
||||
String inOrderNumber = materialInventoryPO.getInOrderNumber();
|
||||
Long warehouseId = materialInventoryPO.getWarehouseId();
|
||||
Date lastBillingTime = materialInventoryPO.getLastBillingTime();
|
||||
if (warehouseId==19) {//干仓计费
|
||||
Map<String,Object> shipperParameters = materialInventoryDomainService.queryShipperParameters(Long.valueOf(shipperId),"干仓计费配置");
|
||||
//客户未配置干仓计费配置
|
||||
if (shipperParameters == null || shipperParameters.size()==0) continue;
|
||||
Long contractManageId = (Long) shipperParameters.get("contractManageId");
|
||||
Long settlementCustomersId = (Long) shipperParameters.get("settlementCustomersId");
|
||||
String contractNumber = (String) shipperParameters.get("contractNumber");
|
||||
String content = (String) shipperParameters.get("content");
|
||||
Map<String, Object> contentMap = content != null ? JSON.parseObject(content, Map.class) : new HashMap<>();
|
||||
Integer sfzdcz = (Integer) contentMap.get("sfzdcz");
|
||||
//客户未配置或是否自动推送设置为否
|
||||
if (sfzdcz==null) continue;
|
||||
if (sfzdcz!=1) continue;
|
||||
//计算费用
|
||||
List<Map<String, Object>> monthFee = materialInventoryDomainService.getMonthFee(inOrderNumber, materialBaseInfoId,lotNumber);
|
||||
//入库业务单未设置每月仓租
|
||||
if (monthFee == null || monthFee.size()==0) continue;
|
||||
Map<String, Object> feeMap = monthFee.get(0);
|
||||
//半月仓租
|
||||
BigDecimal halfMonthWhFee = (BigDecimal) feeMap.get("halfMonthWhFee");
|
||||
//整月仓租
|
||||
BigDecimal monthlyWarehouseFee = (BigDecimal) feeMap.get("monthlyWarehouseFee");
|
||||
// 判断是否为昨天
|
||||
boolean isYesterday = false;
|
||||
if (createTime != null) {
|
||||
LocalDate yesterday = LocalDate.now().minusDays(1);
|
||||
LocalDate createDate = createTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
isYesterday = yesterday.isEqual(createDate);
|
||||
}
|
||||
if (isYesterday) {
|
||||
//首次计费 需要夫力费
|
||||
//库存数量
|
||||
BigDecimal inventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
||||
//仓租
|
||||
BigDecimal totalWarehouseRent = inventoryQuantity.multiply(monthlyWarehouseFee);
|
||||
//夫力费
|
||||
BigDecimal manpowerFee = totalWarehouseRent.multiply(new BigDecimal("0.2"));
|
||||
MaterialBaseInfo materialBaseInfo = materialBaseInfoMapper.selectById(materialBaseInfoId);
|
||||
BigDecimal unitPrice = materialBaseInfo.getUnitPrice();
|
||||
//火险保费
|
||||
BigDecimal fireInsureFee = unitPrice.multiply(inventoryQuantity).multiply(new BigDecimal("0.0003"));
|
||||
buildBusinessDocument(totalWarehouseRent, materialInventoryPO,"0D081","干仓仓租费用",contractManageId,"干仓");
|
||||
buildBusinessDocument(manpowerFee, materialInventoryPO,"0D082","夫力费",contractManageId,"干仓");
|
||||
buildBusinessDocument(fireInsureFee, materialInventoryPO,"0D083","火险保费",contractManageId,"干仓");
|
||||
|
||||
} else {
|
||||
//期间付费 不需要夫力费
|
||||
//库存数量
|
||||
BigDecimal inventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
||||
//仓租
|
||||
BigDecimal totalWarehouseRent = inventoryQuantity.multiply(monthlyWarehouseFee);
|
||||
MaterialBaseInfo materialBaseInfo = materialBaseInfoMapper.selectById(materialBaseInfoId);
|
||||
BigDecimal unitPrice = materialBaseInfo.getUnitPrice();
|
||||
//火险保费
|
||||
BigDecimal fireInsureFee = unitPrice.multiply(inventoryQuantity).multiply(new BigDecimal("0.0003"));
|
||||
buildBusinessDocument(totalWarehouseRent, materialInventoryPO,"0D081","干仓仓租费用",contractManageId,"干仓");
|
||||
buildBusinessDocument(fireInsureFee, materialInventoryPO,"0D083","火险保费",contractManageId,"干仓");
|
||||
}
|
||||
} else if (warehouseId==20) {//冻仓计费
|
||||
Map<String,Object> shipperParameters = materialInventoryDomainService.queryShipperParameters(Long.valueOf(shipperId),"冻仓计费配置");
|
||||
if (shipperParameters == null || shipperParameters.size()==0) continue;
|
||||
Long contractManageId = (Long) shipperParameters.get("contractManageId");
|
||||
Long settlementCustomersId = (Long) shipperParameters.get("settlementCustomersId");
|
||||
String contractNumber = (String) shipperParameters.get("contractNumber");
|
||||
String content = (String) shipperParameters.get("content");
|
||||
Map<String, Object> contentMap = content != null ? JSON.parseObject(content, Map.class) : new HashMap<>();
|
||||
Integer sfzdcz = (Integer) contentMap.get("sfzdcz");
|
||||
//客户未配置或是否自动推送设置为否
|
||||
if (sfzdcz==null) continue;
|
||||
if (sfzdcz!=1) continue;
|
||||
//计算费用
|
||||
MaterialBaseInfo materialBaseInfo = materialBaseInfoMapper.selectById(materialBaseInfoId);
|
||||
BigDecimal unitPrice = materialBaseInfo.getUnitPrice();
|
||||
String materialClassifyId = materialBaseInfo.getMaterialClassifyId();
|
||||
BigDecimal weightLimit = materialBaseInfo.getWeightLimit();
|
||||
Map<String,Object> materialClassify = materialInventoryDomainService.queryMaterialClassify(Long.valueOf(materialClassifyId));
|
||||
//物料分类不存在
|
||||
if (materialClassify == null || materialClassify.size()==0) continue;
|
||||
BigDecimal monthlyWarehouseRent = (BigDecimal) materialClassify.get("monthlyWarehouseRent");
|
||||
BigDecimal halfMonthWarehouseRent = (BigDecimal) materialClassify.get("halfMonthWarehouseRent");
|
||||
String monthlyWarehouseRentUnit = (String) materialClassify.get("monthlyWarehouseRentUnit");
|
||||
String halfMonthWarehouseRentUnit = (String) materialClassify.get("halfMonthWarehouseRentUnit");
|
||||
//半月仓租
|
||||
BigDecimal halfMonthWhFee = halfMonthWarehouseRent;
|
||||
//整月仓租
|
||||
BigDecimal monthlyWarehouseFee = monthlyWarehouseRent;
|
||||
long daysDiff = 0;
|
||||
if (lastBillingTime != null) {
|
||||
LocalDate lastBillingDate = lastBillingTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
daysDiff = ChronoUnit.DAYS.between(lastBillingDate, LocalDate.now());
|
||||
} else {
|
||||
daysDiff = -1;
|
||||
}
|
||||
BigDecimal inventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
||||
if (daysDiff < 15) {
|
||||
// 不足半月: 收半月仓租
|
||||
BigDecimal totalWarehouseRent = inventoryQuantity.multiply(halfMonthWhFee).multiply(weightLimit);
|
||||
buildBusinessDocument(totalWarehouseRent, materialInventoryPO,"0D081","冻仓仓租费用",contractManageId,"冻仓");
|
||||
} else {
|
||||
// 大于等于半月: 收整月仓租
|
||||
BigDecimal totalWarehouseRent = inventoryQuantity.multiply(monthlyWarehouseFee).multiply(weightLimit);
|
||||
buildBusinessDocument(totalWarehouseRent, materialInventoryPO,"0D081","冻仓仓租费用",contractManageId,"冻仓");
|
||||
}
|
||||
//更新最后计费时间
|
||||
Long materialInventoryId = materialInventoryPO.getMaterialInventoryId();
|
||||
MaterialInventory materialInventory = materialInventoryMapper.selectById(materialInventoryId);
|
||||
materialInventory.setLastBillingTime(new Date());
|
||||
materialInventoryMapper.updateById(materialInventory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void buildBusinessDocument(BigDecimal fee, MaterialInventoryPO materialInventoryPO) {
|
||||
private void buildBusinessDocument(BigDecimal fee, MaterialInventoryPO materialInventoryPO,String code,String name,Long contractManageId,String warehouseType) {
|
||||
Long shipperId = materialInventoryPO.getShipperId();
|
||||
Map<String, Object> shipper = materialInventoryMapper.querySetlleByShipperId(shipperId);
|
||||
if (shipper == null) {
|
||||
@@ -960,23 +1161,27 @@ public class MaterialInventoryApplicationService {
|
||||
businessDocumentFeign.setSettlementEntity(settlementEntity);
|
||||
businessDocumentFeign.setSettlementCustomersId(settlementCustomersId);
|
||||
businessDocumentFeign.setSettlementCustomersCode(settlementCustomersCode);
|
||||
businessDocumentFeign.setDocumentTypeId(5l);
|
||||
businessDocumentFeign.setDocumentTypeCode("CM_SZ");
|
||||
businessDocumentFeign.setDocumentType("仓码散租");
|
||||
businessDocumentFeign.setFirstSubjectCode("0D81");
|
||||
businessDocumentFeign.setFirstSubjectName("仓租费");
|
||||
businessDocumentFeign.setDocumentTypeId(4l);
|
||||
businessDocumentFeign.setDocumentTypeCode("CM_ZL");
|
||||
businessDocumentFeign.setDocumentType("仓库租赁单");
|
||||
businessDocumentFeign.setFirstSubjectCode(code);
|
||||
businessDocumentFeign.setFirstSubjectName(name);
|
||||
businessDocumentFeign.setBillingTime(new Date());
|
||||
businessDocumentFeign.setServiceItemsCode("CMCZ");
|
||||
businessDocumentFeign.setServiceItemsName("干仓仓租");
|
||||
businessDocumentFeign.setServiceItemsCode("GC_CZ");
|
||||
businessDocumentFeign.setServiceItemsName("干仓仓租费用");
|
||||
businessDocumentFeign.setSettlementWay(1);
|
||||
Map<String, Object> contract = materialInventoryDomainService.queryContract(materialInventoryPO.getShipperId());
|
||||
businessDocumentFeign.setOriginalBusinessNum(materialInventoryPO.getInOrderNumber());
|
||||
businessDocumentFeign.setWarehouseType(warehouseType);
|
||||
businessDocumentFeign.setOriginalBusinessNum(materialInventoryPO.getInOrderNumber());
|
||||
Map<String, Object> contract = materialInventoryDomainService.queryContract(contractManageId);
|
||||
if (contract == null) {return;}
|
||||
String contractName = (String) contract.get("contractName");
|
||||
String contractNumber = (String) contract.get("contractNumber");
|
||||
Long contractManageId = (Long) contract.get("contractManageId");
|
||||
businessDocumentFeign.setContractName(contractName);
|
||||
businessDocumentFeign.setContractNumber(contractNumber);
|
||||
businessDocumentFeign.setContractManageId(contractManageId);
|
||||
businessDocumentFeign.setBusinessFlow(OrderSequence.getOrderCode("LS"));
|
||||
businessDocumentFeign.setIsPush(1);
|
||||
AjaxResult ajaxResult = bmsServiceFeign.feignSaveBusinessDocument(businessDocumentFeign);
|
||||
if (ajaxResult == null || !"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
log.error("保存业务单据失败: {}", ajaxResult != null ? ajaxResult.get("msg") : "feign调用异常");
|
||||
|
||||
+18
-7
@@ -351,7 +351,7 @@ public class HandoverTaskOrderDomainService {
|
||||
}
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
//修改库存
|
||||
xgkc(handoverTaskOrderIds,loginUser);
|
||||
List<MaterialInventoryParamDO> clearoutParamDOs = xgkc(handoverTaskOrderIds,loginUser);
|
||||
//推送oms(需报关的单子等海关确认放行后再推)
|
||||
for (Long handoverTaskOrderId : handoverTaskOrderIds) {
|
||||
// HandoverTaskOrder hto = handoverTaskOrderService.getById(handoverTaskOrderId);
|
||||
@@ -371,6 +371,7 @@ public class HandoverTaskOrderDomainService {
|
||||
}
|
||||
HandoverTaskOrder handoverTaskOrder = handoverTaskOrderService.getById(handoverTaskOrderIds.get(0));
|
||||
stockOutOrderService.update(null,new UpdateWrapper<StockOutOrder>().lambda().set(StockOutOrder::getBillingJson,handoverTaskOrderDO.getBillingJson()).eq(StockOutOrder::getOutOrderNumber,handoverTaskOrder.getOrderNumber()));
|
||||
this.lastClearoutParamDOs = clearoutParamDOs;
|
||||
return handoverTaskOrderService.update(null, new UpdateWrapper<HandoverTaskOrder>().lambda()
|
||||
.set(HandoverTaskOrder::getStatus, 2)
|
||||
.set(HandoverTaskOrder::getUpdateBy, loginUser.getUserid())
|
||||
@@ -398,11 +399,18 @@ public class HandoverTaskOrderDomainService {
|
||||
@Autowired
|
||||
private ICopyCodeReferenceService copyCodeReferenceService;
|
||||
|
||||
public synchronized void xgkc(List<Long> handoverTaskOrderIds,LoginUser loginUser) {
|
||||
private List<MaterialInventoryParamDO> lastClearoutParamDOs = new ArrayList<>();
|
||||
|
||||
public List<MaterialInventoryParamDO> getLastClearoutParamDOs() {
|
||||
return lastClearoutParamDOs;
|
||||
}
|
||||
|
||||
public synchronized List<MaterialInventoryParamDO> xgkc(List<Long> handoverTaskOrderIds,LoginUser loginUser) {
|
||||
List<MaterialInventoryParamDO> allClearoutParamDOs = new ArrayList<>();
|
||||
for (Long handoverTaskOrderId : handoverTaskOrderIds) {
|
||||
HandoverTaskOrder handoverTaskOrder = handoverTaskOrderService.getById(handoverTaskOrderId);
|
||||
if (handoverTaskOrder == null) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
//交接完成节点修改库存
|
||||
String orderNumber = handoverTaskOrder.getOrderNumber();
|
||||
@@ -422,15 +430,17 @@ public class HandoverTaskOrderDomainService {
|
||||
//完成交接状态改为已出库
|
||||
stockOutOrder.setStatus(9);
|
||||
stockOutOrderMapper.updateById(stockOutOrder);
|
||||
doStockOutDeduct(orderNumber, stockOutOrder, loginUser);
|
||||
allClearoutParamDOs.addAll(doStockOutDeduct(orderNumber, stockOutOrder, loginUser));
|
||||
}
|
||||
return allClearoutParamDOs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库扣减:同步OMS明细 + 联单状态 + 扣实物库存 + 推OMS库存
|
||||
* (从 xgkc 抽取,供「不需报关交接」和「海关确认」两处复用)
|
||||
*/
|
||||
private void doStockOutDeduct(String orderNumber, StockOutOrder stockOutOrder, LoginUser loginUser) {
|
||||
private List<MaterialInventoryParamDO> doStockOutDeduct(String orderNumber, StockOutOrder stockOutOrder, LoginUser loginUser) {
|
||||
List<MaterialInventoryParamDO> clearoutParamDOs = new ArrayList<>();
|
||||
List<OutMaterialDetail> outMaterialDetailList = outMaterialDetailMapper.selectList(new QueryWrapper<OutMaterialDetail>().lambda()
|
||||
.eq(OutMaterialDetail::getOutOrderNumber, orderNumber)
|
||||
.eq(OutMaterialDetail::getDelFlag, 1));
|
||||
@@ -489,16 +499,17 @@ public class HandoverTaskOrderDomainService {
|
||||
materialInventoryOmsParamDO.setLoginUser(loginUser);
|
||||
if (stockOutOrder != null && !"yang_pin_chu_ku".equals(stockOutOrder.getBusinessType())) {
|
||||
materialInventoryService.kctzjl(materialInventoryParamDO,"出库",loginUser);
|
||||
materialInventoryService.xgkc(materialInventoryParamDO);
|
||||
clearoutParamDOs.addAll(materialInventoryService.xgkc(materialInventoryParamDO));
|
||||
//库存推送oms
|
||||
omsServiceFeign.omsEdit(materialInventoryOmsParamDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
return clearoutParamDOs;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 定时任务入口:每小时整点扫描「已交接(13)」状态的需报关出库单,调 sendDec 查报关结果,
|
||||
// * 定时任务入口
|
||||
// * 放行/结关的 → 状态 13→9 + 扣库存 + 推OMS;未放行 → 跳过下次再查。
|
||||
// * 由 @Scheduled 触发,无需在 sys_job 表配置。
|
||||
// */
|
||||
|
||||
+16
@@ -243,4 +243,20 @@ public class MaterialBaseInfo extends BaseVOEntity {
|
||||
@ApiModelProperty(name = "是否正常物料: 0-是 1-否")
|
||||
private Integer isNormalMaterial;
|
||||
|
||||
@ApiModelProperty("每月仓租")
|
||||
@Excel(name = "每月仓租")
|
||||
private BigDecimal monthlyWarehouseRent;
|
||||
|
||||
@ApiModelProperty("半月仓租")
|
||||
@Excel(name = "半月仓租")
|
||||
private BigDecimal halfMonthWarehouseRent;
|
||||
|
||||
@ApiModelProperty("每月仓租单位")
|
||||
@Excel(name = "每月仓租单位")
|
||||
private String monthlyWarehouseRentUnit;
|
||||
|
||||
@ApiModelProperty("半月仓租单位")
|
||||
@Excel(name = "半月仓租单位")
|
||||
private String halfMonthWarehouseRentUnit;
|
||||
|
||||
}
|
||||
+16
@@ -292,4 +292,20 @@ public class MaterialBaseInfoPO extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty(name = "是否正常物料: 0-是 1-否")
|
||||
private Integer isNormalMaterial;
|
||||
|
||||
@ApiModelProperty("每月仓租")
|
||||
@Excel(name = "每月仓租")
|
||||
private BigDecimal monthlyWarehouseRent;
|
||||
|
||||
@ApiModelProperty("半月仓租")
|
||||
@Excel(name = "半月仓租")
|
||||
private BigDecimal halfMonthWarehouseRent;
|
||||
|
||||
@ApiModelProperty("每月仓租单位")
|
||||
@Excel(name = "每月仓租单位")
|
||||
private String monthlyWarehouseRentUnit;
|
||||
|
||||
@ApiModelProperty("半月仓租单位")
|
||||
@Excel(name = "半月仓租单位")
|
||||
private String halfMonthWarehouseRentUnit;
|
||||
}
|
||||
+16
@@ -265,4 +265,20 @@ public class MaterialBaseInfoDO extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty(name = "是否正常物料: 0-是 1-否")
|
||||
private Integer isNormalMaterial;
|
||||
|
||||
@ApiModelProperty("每月仓租")
|
||||
@Excel(name = "每月仓租")
|
||||
private BigDecimal monthlyWarehouseRent;
|
||||
|
||||
@ApiModelProperty("半月仓租")
|
||||
@Excel(name = "半月仓租")
|
||||
private BigDecimal halfMonthWarehouseRent;
|
||||
|
||||
@ApiModelProperty("每月仓租单位")
|
||||
@Excel(name = "每月仓租单位")
|
||||
private String monthlyWarehouseRentUnit;
|
||||
|
||||
@ApiModelProperty("半月仓租单位")
|
||||
@Excel(name = "半月仓租单位")
|
||||
private String halfMonthWarehouseRentUnit;
|
||||
}
|
||||
+6
@@ -236,4 +236,10 @@ public class MaterialInventory extends BaseVOEntity {
|
||||
@Excel(name = "LOT编号")
|
||||
private String lotNumber;
|
||||
|
||||
@ApiModelProperty("上次计费时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "上次计费时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastBillingTime;
|
||||
|
||||
}
|
||||
+7
-2
@@ -15,6 +15,7 @@ import com.mhd.wms.domain.statementStatistics.todo.ImmediateInventoryDO;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 物料库存Service接口
|
||||
@@ -118,7 +119,7 @@ public interface IMaterialInventoryService extends IService<MaterialInventory>
|
||||
* type 类型(1:上架2:分配3:取消分配4:出库交接5:移位6:库存调整7:库存冻结)
|
||||
* materialInventoryId 物料库存ID
|
||||
* */
|
||||
public void xgkc(MaterialInventoryParamDO materialInventoryParamDO);
|
||||
public List<MaterialInventoryParamDO> xgkc(MaterialInventoryParamDO materialInventoryParamDO);
|
||||
|
||||
public void kctzjl(MaterialInventoryParamDO materialInventoryParamDO,String adjustAction,LoginUser loginUser);
|
||||
|
||||
@@ -130,5 +131,9 @@ public interface IMaterialInventoryService extends IService<MaterialInventory>
|
||||
|
||||
public Map<String,Object> querySetlleByShipperId(Long ShipperId);
|
||||
|
||||
public Map<String,Object> queryContract(Long shipperId);
|
||||
public Map<String,Object> queryContract(Long contractManageId);
|
||||
|
||||
public Map<String,Object> queryShipperParameters(Long shipperId,String parametersName);
|
||||
|
||||
Map<String, Object> queryMaterialClassify(Long id);
|
||||
}
|
||||
+5
-1
@@ -135,5 +135,9 @@ public interface MaterialInventoryMapper extends BaseMapper<MaterialInventory>
|
||||
|
||||
public Map<String,Object> querySetlleByShipperId(@Param("shipperId") Long shipperId);
|
||||
|
||||
public Map<String,Object> queryContract(@Param("shipperId") Long shipperId);
|
||||
public Map<String,Object> queryContract(@Param("contractManageId") Long contractManageId);
|
||||
|
||||
public Map<String,Object> queryShipperParameters(@Param("shipperId") Long shipperId,@Param("parametersName") String parametersName);
|
||||
|
||||
public Map<String, Object> queryMaterialClassify(@Param("id") Long id);
|
||||
}
|
||||
+34
-5
@@ -544,7 +544,7 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void xgkc(MaterialInventoryParamDO materialInventoryParamDO) {
|
||||
public List<MaterialInventoryParamDO> xgkc(MaterialInventoryParamDO materialInventoryParamDO) {
|
||||
BigDecimal netWeight = materialInventoryParamDO.getNetWeight() != null ? materialInventoryParamDO.getNetWeight() : BigDecimal.ZERO;
|
||||
BigDecimal grossWeight = materialInventoryParamDO.getGrossWeight() != null ? materialInventoryParamDO.getGrossWeight() : BigDecimal.ZERO;
|
||||
BigDecimal volume = materialInventoryParamDO.getVolume() != null ? materialInventoryParamDO.getVolume() : BigDecimal.ZERO;
|
||||
@@ -552,6 +552,7 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
||||
BigDecimal quantity = materialInventoryParamDO.getQuantity() != null ? materialInventoryParamDO.getQuantity() : BigDecimal.ZERO;
|
||||
String type = materialInventoryParamDO.getType();
|
||||
Long materialInventoryId = materialInventoryParamDO.getMaterialInventoryId();
|
||||
List<MaterialInventoryParamDO> clearoutList = new ArrayList<>();
|
||||
|
||||
//类型(1:上架2:分配3:取消分配4:出库交接5:移位6:库存调整7:库存冻结)
|
||||
switch (type) {
|
||||
@@ -569,7 +570,10 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
||||
break;
|
||||
case "4":
|
||||
// 出库交接
|
||||
ckjj(netWeight, grossWeight, volume, area, quantity, materialInventoryId);
|
||||
MaterialInventoryPO po = ckjj(netWeight, grossWeight, volume, area, quantity, materialInventoryId);
|
||||
if (po != null) {
|
||||
clearoutList.add(materialInventoryParamDO);
|
||||
}
|
||||
break;
|
||||
case "5":
|
||||
// 移位
|
||||
@@ -586,6 +590,7 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
||||
default:
|
||||
throw new ServiceException("错误的类型");
|
||||
}
|
||||
return clearoutList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1040,7 +1045,7 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
||||
materialInventoryMapper.updateById(materialInventory);
|
||||
}
|
||||
}
|
||||
private void ckjj(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId) {
|
||||
private MaterialInventoryPO ckjj(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId) {
|
||||
MaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId);
|
||||
if (materialInventoryPO != null) {
|
||||
//库存数量
|
||||
@@ -1087,7 +1092,22 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
||||
MaterialInventory materialInventory = new MaterialInventory();
|
||||
com.mhd.common.core.utils.bean.BeanUtils.copyProperties(materialInventoryPO, materialInventory);
|
||||
materialInventoryMapper.updateById(materialInventory);
|
||||
|
||||
Long warehouseId = materialInventoryPO.getWarehouseId();
|
||||
boolean needPush = false;
|
||||
if (warehouseId != null && warehouseId == 20) {
|
||||
needPush = true;
|
||||
} else if (warehouseId != null && warehouseId == 19 && newInventoryQuantity.compareTo(BigDecimal.ZERO) == 0) {
|
||||
needPush = true;
|
||||
}
|
||||
if (needPush) {
|
||||
MaterialInventoryPO resultPO = new MaterialInventoryPO();
|
||||
com.mhd.common.core.utils.bean.BeanUtils.copyProperties(materialInventoryPO, resultPO);
|
||||
resultPO.setMaterialInventoryId(materialInventoryId);
|
||||
return resultPO;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private void yw(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId) {
|
||||
MaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId);
|
||||
@@ -1253,7 +1273,16 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
||||
return materialInventoryMapper.querySetlleByShipperId(shipperId);
|
||||
}
|
||||
|
||||
public Map<String,Object> queryContract(Long shipperId) {
|
||||
return materialInventoryMapper.queryContract(shipperId);
|
||||
public Map<String,Object> queryContract(Long contractManageId) {
|
||||
return materialInventoryMapper.queryContract(contractManageId);
|
||||
}
|
||||
|
||||
public Map<String,Object> queryShipperParameters(Long shipperId,String parametersName) {
|
||||
return materialInventoryMapper.queryShipperParameters(shipperId,parametersName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryMaterialClassify(Long id) {
|
||||
return materialInventoryMapper.queryMaterialClassify(id);
|
||||
}
|
||||
}
|
||||
+6
@@ -233,4 +233,10 @@ public class MaterialInventoryPO extends MaterialBasePO {
|
||||
@ApiModelProperty("规格型号")
|
||||
@Excel(name = "规格型号")
|
||||
private String specificationModel;
|
||||
|
||||
@ApiModelProperty("上次计费时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "上次计费时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastBillingTime;
|
||||
}
|
||||
+6
@@ -288,4 +288,10 @@ public class MaterialInventoryQueryListPO extends MaterialBasePO {
|
||||
|
||||
@ApiModelProperty("总面积(SQM),PDA 表单区显示")
|
||||
private BigDecimal totalArea;
|
||||
|
||||
@ApiModelProperty("上次计费时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "上次计费时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastBillingTime;
|
||||
}
|
||||
+9
@@ -271,4 +271,13 @@ public class MaterialInventoryDO extends MaterialBaseDO {
|
||||
|
||||
@ApiModelProperty("库存分配匹配:Batch Ref NO's token 列表(默认不启用,仅显式赋值时参与匹配)")
|
||||
private List<String> batchRefNoList;
|
||||
|
||||
@ApiModelProperty("上次计费时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "上次计费时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastBillingTime;
|
||||
|
||||
private String lastBillingTimeStart;
|
||||
private String lastBillingTimeEnd;
|
||||
}
|
||||
+9
@@ -268,4 +268,13 @@ public class MaterialInventoryQueryListDO extends MaterialBaseDO {
|
||||
|
||||
private String updateTimeStart;
|
||||
private String updateTimeEnd;
|
||||
|
||||
@ApiModelProperty("上次计费时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "上次计费时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastBillingTime;
|
||||
|
||||
private String lastBillingTimeStart;
|
||||
private String lastBillingTimeEnd;
|
||||
}
|
||||
+10
-2
@@ -138,7 +138,15 @@ public class MaterialInventoryDomainService {
|
||||
return materialInventoryService.querySetlleByShipperId(shipperId);
|
||||
}
|
||||
|
||||
public Map<String,Object> queryContract(Long shipperId) {
|
||||
return materialInventoryService.queryContract(shipperId);
|
||||
public Map<String,Object> queryContract(Long contractManageId) {
|
||||
return materialInventoryService.queryContract(contractManageId);
|
||||
}
|
||||
|
||||
public Map<String,Object> queryShipperParameters(Long shipperId,String parametersName) {
|
||||
return materialInventoryService.queryShipperParameters(shipperId,parametersName);
|
||||
}
|
||||
|
||||
public Map<String,Object> queryMaterialClassify(Long id) {
|
||||
return materialInventoryService.queryMaterialClassify(id);
|
||||
}
|
||||
}
|
||||
+16
@@ -316,4 +316,20 @@ public class MaterialBaseInfoDTO extends BaseVOEntity {
|
||||
private String orgId;
|
||||
@ApiModelProperty(name = "是否正常物料: 0-是 1-否")
|
||||
private Integer isNormalMaterial;
|
||||
|
||||
@ApiModelProperty("每月仓租")
|
||||
@Excel(name = "每月仓租")
|
||||
private BigDecimal monthlyWarehouseRent;
|
||||
|
||||
@ApiModelProperty("半月仓租")
|
||||
@Excel(name = "半月仓租")
|
||||
private BigDecimal halfMonthWarehouseRent;
|
||||
|
||||
@ApiModelProperty("每月仓租单位")
|
||||
@Excel(name = "每月仓租单位")
|
||||
private String monthlyWarehouseRentUnit;
|
||||
|
||||
@ApiModelProperty("半月仓租单位")
|
||||
@Excel(name = "半月仓租单位")
|
||||
private String halfMonthWarehouseRentUnit;
|
||||
}
|
||||
+7
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -203,4 +204,10 @@ public class MaterialInventoryDTO extends MaterialBaseDTO {
|
||||
private String updateTimeStart;
|
||||
private String updateTimeEnd;
|
||||
|
||||
@ApiModelProperty("上次计费时间")
|
||||
private Date lastBillingTime;
|
||||
|
||||
private String lastBillingTimeStart;
|
||||
private String lastBillingTimeEnd;
|
||||
|
||||
}
|
||||
+7
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -201,4 +202,10 @@ public class MaterialInventoryQueryListDTO extends MaterialBaseDTO {
|
||||
|
||||
private String updateTimeStart;
|
||||
private String updateTimeEnd;
|
||||
|
||||
@ApiModelProperty("上次计费时间")
|
||||
private Date lastBillingTime;
|
||||
|
||||
private String lastBillingTimeStart;
|
||||
private String lastBillingTimeEnd;
|
||||
}
|
||||
@@ -69,6 +69,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="chargeStandard" column="charge_standard" />
|
||||
<result property="chargeStandardClass" column="charge_standard_class" />
|
||||
<result property="isNormalMaterial" column="is_normal_material" />
|
||||
<result property="monthlyWarehouseRent" column="monthly_warehouse_rent" />
|
||||
<result property="halfMonthWarehouseRent" column="half_month_warehouse_rent" />
|
||||
<result property="monthlyWarehouseRentUnit" column="monthly_warehouse_rent_unit" />
|
||||
<result property="halfMonthWarehouseRentUnit" column="half_month_warehouse_rent_unit" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -78,7 +82,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
material_shape_name, a.material_size, a.material_length, a.material_width, a.material_height, a.remark, a.nullify, a.create_time, a.create_by, a.create_by_name, a.update_time, a.update_by, a.update_by_name, a.del_flag, a.common,
|
||||
sku_code, a.unit_price, a.currency, a.origin_country, a.hs_code, a.declaration_unit, a.statutory_unit, a.statutory_second_unit, a.copy_code,
|
||||
a.push_status,a.push_time,a.push_by,a.goods_type,a.gross_weight,a.push_by_name,a.unit,a.INSURE_AMOUNT,a.CHARGE_STANDARD,
|
||||
specification_model as specification_model,nvl(b.stock_qty,0) as stock_quantity,c.charge_standard as charge_standard_class,a.is_normal_material
|
||||
specification_model as specification_model,nvl(b.stock_qty,0) as stock_quantity,c.charge_standard as charge_standard_class,a.is_normal_material,
|
||||
a.monthly_warehouse_rent, a.half_month_warehouse_rent, a.monthly_warehouse_rent_unit, a.half_month_warehouse_rent_unit
|
||||
|
||||
from material_base_info a left join (
|
||||
select material_base_info_id, sum(INVENTORY_QUANTITY) as stock_qty from MATERIAL_INVENTORY group by material_base_info_id
|
||||
|
||||
@@ -65,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="inOrderNumber" column="in_order_number" />
|
||||
<result property="lotNumber" column="lot_number" />
|
||||
<result property="specificationModel" column="specification_model" />
|
||||
<result property="lastBillingTime" column="last_billing_time" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -88,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.BATCH_REF_NO, a.SHEET_REF_NO, a.BOX_PALLET_NO,nvl(a.unit_name,b.unit_name) as unit_name,
|
||||
a.bar_code as inv_bar_code,
|
||||
a.in_order_number,a.lot_number,
|
||||
a.last_billing_time,
|
||||
CASE WHEN IFNULL(sum(a.inventory_quantity), 0) = 0 THEN 1 ELSE 0 END as sort_order
|
||||
</sql>
|
||||
|
||||
@@ -112,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.BATCH_REF_NO, a.SHEET_REF_NO, a.BOX_PALLET_NO,nvl(a.unit_name,b.unit_name) as unit_name,
|
||||
a.bar_code as inv_bar_code,
|
||||
a.in_order_number,a.lot_number,
|
||||
a.last_billing_time,
|
||||
CASE WHEN IFNULL(sum(a.inventory_quantity), 0) = 0 THEN 1 ELSE 0 END as sort_order
|
||||
</sql>
|
||||
|
||||
@@ -263,6 +266,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="expiryDateEnd != null and expiryDateEnd != ''">
|
||||
and a.expiry_date <![CDATA[ < ]]> DATEADD(DAY, 1, #{expiryDateEnd})
|
||||
</if>
|
||||
<if test="lastBillingTimeStart != null and lastBillingTimeStart != ''">
|
||||
and a.last_billing_time >= #{lastBillingTimeStart}
|
||||
</if>
|
||||
<if test="lastBillingTimeEnd != null and lastBillingTimeEnd != ''">
|
||||
and a.last_billing_time <![CDATA[ < ]]> DATEADD(DAY, 1, #{lastBillingTimeEnd})
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<!-- 与 selectMaterialInventoryPo1 相同条件,表别名为 mi(用于 queryListByWl 最新明细子查询) -->
|
||||
@@ -381,6 +390,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="boxPalletNo != null and boxPalletNo != ''">
|
||||
and mi.BOX_PALLET_NO like concat('%', #{boxPalletNo}, '%')
|
||||
</if>
|
||||
<if test="lastBillingTimeStart != null and lastBillingTimeStart != ''">
|
||||
and mi.last_billing_time >= #{lastBillingTimeStart}
|
||||
</if>
|
||||
<if test="lastBillingTimeEnd != null and lastBillingTimeEnd != ''">
|
||||
and mi.last_billing_time <![CDATA[ < ]]> DATEADD(DAY, 1, #{lastBillingTimeEnd})
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO" resultMap="MaterialInventoryResult">
|
||||
@@ -537,6 +552,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
MAX(a.batch_ref_no) AS batch_ref_no, MAX(a.sheet_ref_no) AS sheet_ref_no, MAX(a.box_pallet_no) AS box_pallet_no,
|
||||
MAX(a.bar_code) AS inv_bar_code,
|
||||
MAX(a.in_order_number) AS in_order_number, MAX(a.lot_number) AS lot_number,
|
||||
MAX(a.last_billing_time) AS last_billing_time,
|
||||
MAX(b.specification_model) AS specification_model,
|
||||
MAX(b.material_code) AS material_code, MAX(b.material_name) AS material_name,
|
||||
CASE WHEN IFNULL(SUM(a.inventory_quantity), 0) = 0 THEN 1 ELSE 0 END AS sort_order
|
||||
@@ -629,6 +645,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
IFNULL(SUM(a.VOLUME), 0) AS VOLUME,
|
||||
MIN(a.create_time) AS create_time,
|
||||
MAX(a.update_time) AS update_time,
|
||||
MAX(a.last_billing_time) AS last_billing_time,
|
||||
CASE WHEN IFNULL(SUM(a.inventory_quantity), 0) = 0 THEN 1 ELSE 0 END AS sort_order
|
||||
</sql>
|
||||
|
||||
@@ -728,6 +745,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateByName" column="update_by_name" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="lastBillingTime" column="last_billing_time" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 1-按货主 2-按物料 3-按批次 4-按库位 5-按物料/库位 6-按容器 0-全部 -->
|
||||
@@ -1705,7 +1723,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
SELECT *
|
||||
FROM MATERIAL_INVENTORY
|
||||
WHERE EXTRACT(DAY FROM CREATE_TIME) = EXTRACT(DAY FROM SYSDATE - 1) AND INVENTORY_QUANTITY > 0
|
||||
AND DEL_FLAG = 1 AND SHIIPER_ID = #{shipperId}
|
||||
AND DEL_FLAG = 1 AND SHIPPER_ID = #{shipperId}
|
||||
</select>
|
||||
|
||||
|
||||
@@ -1725,21 +1743,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="querySetlleByShipperId" parameterType="java.lang.Long" resultType="java.util.Map">
|
||||
SELECT
|
||||
SETTLEMENT_ENTITY as settlementEntity,
|
||||
SETTLEMENT_ENTITY_ID as settlementEntityId,
|
||||
SETTLEMENT_CUSTOMERS_CODE as settlementCustomersCode,
|
||||
SETTLEMENT_CUSTOMERS_ID as settlementCustomersId
|
||||
FROM NGWL_TEST_OMS.SETTLEMENT_CUSTOMERS where 1=1 and
|
||||
SETTLEMENT_ENTITY_ID = #{settlementEntityId}
|
||||
SETTLEMENT_ENTITY as "settlementEntity",
|
||||
SETTLEMENT_ENTITY_ID as "settlementEntityId",
|
||||
SETTLEMENT_CUSTOMERS_CODE as "settlementCustomersCode",
|
||||
SETTLEMENT_CUSTOMERS_ID as "settlementCustomersId"
|
||||
FROM NGWL_TEST_BMS.SETTLEMENT_CUSTOMERS where 1=1 and
|
||||
SETTLEMENT_ENTITY_ID = #{shipperId} AND DEL_FLAG = 1
|
||||
</select>
|
||||
|
||||
<select id="queryContract" parameterType="java.lang.Long" resultType="java.util.Map">
|
||||
SELECT
|
||||
CONTRACT_MANAGE_ID as contractManageId,
|
||||
ORIGINAL_CONTRACT_NUMBER as originalContractNumber,
|
||||
CONTRACT_NUMBER as contractNumber,
|
||||
CONTRACT_NAME as contractName
|
||||
FROM NGWL_TEST_SYSTEM.CONTRACT_MANAGE where 1=1 and
|
||||
SETTLEMENT_CUSTOMERS_ID = #{shipperId}
|
||||
CONTRACT_MANAGE_ID AS "contractManageId",
|
||||
ORIGINAL_CONTRACT_NUMBER AS "originalContractNumber",
|
||||
CONTRACT_NUMBER AS "contractNumber",
|
||||
CONTRACT_NAME AS "contractName"
|
||||
FROM
|
||||
NGWL_TEST_SYSTEM.CONTRACT_MANAGE sys
|
||||
LEFT JOIN NGWL_TEST_BMS.SETTLEMENT_CUSTOMERS bms ON sys.SETTLEMENT_CUSTOMERS_ID = bms.SETTLEMENT_CUSTOMERS_ID
|
||||
WHERE
|
||||
1 = 1
|
||||
AND CONTRACT_MANAGE_ID = #{contractManageId} AND DEL_FLAG = 1
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryShipperParameters" resultType="java.util.Map">
|
||||
SELECT
|
||||
PARAMETERS_NAME AS "parametersName",
|
||||
CONTENT AS "content",
|
||||
CONTRACT_NUMBER AS "contractNumber",
|
||||
SETTLEMENT_CUSTOMERS_ID AS "settlementCustomersId",
|
||||
CONTRACT_MANAGE_ID AS "contractManageId"
|
||||
FROM
|
||||
NGWL_TEST_BMS.SETTLEMENT_CUSTOMERS_PARAMETERS
|
||||
WHERE
|
||||
1 = 1
|
||||
AND SETTLEMENT_ENTITY_ID = #{shipperId} and PARAMETERS_NAME = #{parametersName}
|
||||
</select>
|
||||
|
||||
<select id="queryMaterialClassify" resultType="java.util.Map">
|
||||
SELECT
|
||||
MONTHLY_WAREHOUSE_RENT AS "monthlyWarehouseRent",
|
||||
HALF_MONTH_WAREHOUSE_RENT AS "halfMonthWarehouseRent",
|
||||
MONTHLY_WAREHOUSE_RENT_UNIT AS "monthlyWarehouseRentUnit",
|
||||
HALF_MONTH_WAREHOUSE_RENT_UNIT AS "halfMonthWarehouseRentUnit"
|
||||
FROM
|
||||
NGWL_TEST_SYSTEM.MATERIAL_CLASSIFY
|
||||
WHERE
|
||||
1 = 1
|
||||
AND MATERIAL_CLASSIFY_ID = #{id} AND DEL_FLAG = 1
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user