Commit 966562de by ice

采购申请下推采购订单itemid为空时自动补充、销售发货寄售时默认填入寄售区

parent 6e8027e6
......@@ -84,6 +84,14 @@ public class PurOrderHeaderController {
purOrderHeaderPage.setBuyerId(hrPerson.getId());
//插入库存现有量
for(PurOrderLine purOrderLine:purOrderHeaderPage.getPurOrderLineList()){
//判断item_id
if(null == purOrderLine.getItemId() || "".equals(purOrderLine.getItemId())){
InvItem invItem= inventoryServer.selectInvItemByItemCodeWithInvIdOne(purOrderLine.getItemCode());
if(invItem == null){
return new Result(false,StatusCode.ERROR,"下推失败!当前商品不存在,请检查!");
}
purOrderLine.setItemId(invItem.getId());
}
Integer sumItemIdQuantity = transactionServer.findByOrgIdAndItemId(purOrderHeaderPage.getOrgId(),purOrderLine.getItemId());
purOrderLine.setAttribute1(String.valueOf(sumItemIdQuantity));
}
......
......@@ -82,21 +82,20 @@ public class WshShipmentController {
HrOrganization hrOrganization = (HrOrganization) map.get("hrOrganization");
wshShipmentHeaderPage.setSysOrgCode(hrOrganization.getOrgCode());
//赋值库存
Map<String,Object> paramMap = findWshParam(wshShipmentHeaderPage.getInvId());
String orderTypeCode = salOrderHeaderService.findBySalOrderHeaderId(wshShipmentHeaderPage.getSourceHeaderId());
Map<String,Object> wshParam = findWshParam(wshShipmentHeaderPage.getInvId());
Map<String,Object> paramMap = new HashMap<>();
if("ST007".equals(orderTypeCode)) {//寄售业务
paramMap = getWshParam(wshParam, "CONSIGNMENT");
}else{
paramMap = getWshParam(wshParam, "STORAGE");
}
WshParameter wshParameter = (WshParameter) paramMap.get("wshParameter");
int label = (int) paramMap.get("label");
wshShipmentHeaderPage.setInvId(wshParameter.getInvId());
// for (int i=1;i<=wshShipmentHeaderPage.getWshShipmentLineList().size();i++){
// WshShipmentLine wshShipmentLine = wshShipmentHeaderPage.getWshShipmentLineList().get(i);
// wshShipmentLine.setLineNumber(String.valueOf(i));
// wshShipmentLine.setSubinvId(wshParameter.getDefaultShippingSubinvId());
// if(label == 1){
// wshShipmentLine.setLocatorId(wshParameter.getDefaultShippingLocatorId());
// }
// }
for(WshShipmentLine wshShipmentLine:wshShipmentHeaderPage.getWshShipmentLineList()){
wshShipmentLine.setSubinvId(wshParameter.getDefaultShippingSubinvId());
if(label == 1){
if (label == 1) {
wshShipmentLine.setLocatorId(wshParameter.getDefaultShippingLocatorId());
}
}
......@@ -308,12 +307,26 @@ public class WshShipmentController {
public Map<String,Object> findWshParam(String orgId){
Map<String,Object> map = new HashMap<>();
Map<String,Object> wshMap = new HashMap<>();
String orgCode = organzitionServer.selectOrgCode(orgId);
if(orgCode == null || "".equals(orgCode)){
throw ErrorEnum.Error.createException("当前组织code不存在,请维护!");
}
WshParameter wshParameter = parameterService.findWshParamByOrg(orgCode);
List<WshParameter> wshParameterList = parameterService.findWshParamByOrg(orgCode);
for(WshParameter wshParam:wshParameterList){
InvSubinventory invSubinventory = inventoryServer.selectSubInventoryBySubInvId(wshParam.getDefaultShippingSubinvId());
String subinvType = invSubinventory.getSubinvType();
wshMap.put(subinvType,wshParam);
}
return wshMap;
}
public Map<String,Object> getWshParam(Map<String,Object> wshMap,String subinvType){
Map<String,Object> map = new HashMap<>();
WshParameter wshParameter = (WshParameter) wshMap.get(subinvType);
if(wshParameter == null && "CONSIGNMENT".equals(subinvType)){
wshParameter = (WshParameter) wshMap.get("STORAGE");
}
if(wshParameter == null){
throw ErrorEnum.Error.createException("请维护发货参数!");
}
......
......@@ -71,4 +71,8 @@ public interface SalOrderTypeMapper{
"(#{id},#{createBy},#{createTime},#{updateBy},#{updateTime},#{attributeCategory},#{sysOrgCode},#{attribute1},#{attribute2},#{attribute3},#{attribute4},#{attribute5},#{attribute6},#{attribute7},#{attribute8},#{attribute9},#{attribute10},#{orgId},#{orderTypeCode},#{orderTypeName},#{orderTypeDesc},#{invTxTypeId},#{consignmentFlag},#{sellerId},#{pricelListId},#{paymentTerms},#{paymentMethod},#{deliveryTerms},#{defaultShippingInvId},#{defaultShippingSubinvId},#{defualtShippingLocatorId},#{defualtConsignmentInvId},#{defaultConsignmentSubinvId},#{defaultStageInvId},#{defaultConsignmentLocatorId},#{defaultStageSubinvId},#{status},#{defaultStageLocatorId})"
)
Integer insert(SalOrderType SalOrderType);
//查出销售订单的业务类型
@Select("select order_type_code from sal_order_type where id = (select order_type_id from sal_order_header where id = #{id})")
String selectBySalOrderHeaderId(@Param("id")String id);
}
\ No newline at end of file
......@@ -25,8 +25,7 @@ public class ParameterService {
return CollectionUtils.isEmpty(rcvParameterList)?null:rcvParameterList.get(0);
}
public WshParameter findWshParamByOrg(String orgId){
List<WshParameter> wshParameterList = wshParameterMapper.selectWshParamByOrg(orgId);
return CollectionUtils.isEmpty(wshParameterList)?null:wshParameterList.get(0);
public List<WshParameter> findWshParamByOrg(String orgId){
return wshParameterMapper.selectWshParamByOrg(orgId);
}
}
......@@ -4,6 +4,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import orthopedics.dao.SalOrderHeaderMapper;
import orthopedics.dao.SalOrderLineMapper;
import orthopedics.dao.SalOrderTypeMapper;
import orthopedics.model.SalOrderHeader;
import java.time.LocalDateTime;
......@@ -15,6 +16,8 @@ public class SalOrderHeaderService {
private SalOrderHeaderMapper salOrderHeaderMapper;
@Autowired
private SalOrderLineMapper salOrderLineMapper;
@Autowired
private SalOrderTypeMapper salOrderTypeMapper;
public SalOrderHeader findSalOrderById(String id){
return salOrderHeaderMapper.selectSalOrderById(id);
......@@ -34,4 +37,8 @@ public class SalOrderHeaderService {
salOrderLineMapper.updateOrderLineStatus(updateBy, updateTime, status, id);
return salOrderHeaderMapper.updateSalOrderHeaderStatus(updateBy, updateTime, status, id);
}
public String findBySalOrderHeaderId(String id){
return salOrderTypeMapper.selectBySalOrderHeaderId(id);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment