wms修改2

master
mengjiao 5 months ago
parent 9ced49d488
commit 0aa30108d6

@ -147,4 +147,13 @@ public class OdsProcureOutOrderController extends BaseController {
List<OdsProcureOutOrder> list = odsProcureOutOrderService.listReturnDY(odsProcureOutOrder);
return success(list);
}
//特殊出库
@PostMapping("/listckTS")
public TableDataInfo listckTS( OdsProcureOutOrder odsProcureOutOrder) {
startPage();
List<OdsProcureOutOrder> list = odsProcureOutOrderService.listckTS(odsProcureOutOrder);
return getDataTable(list);
}
}

@ -111,4 +111,10 @@ public class WmsOdsMateStorageNewsController extends BaseController {
List<WmsOdsMateStorageNews> list = wmsOdsMateStorageNewsService.selectWmsOdsMateStorageNewslsList(wmsOdsMateStorageNews);
return getDataTable(list);
}
@GetMapping("/listWmsOdsMateStorageNews")
public TableDataInfo listWmsOdsMateStorageNews(WmsOdsMateStorageNews wmsOdsMateStorageNews) {
startPage();
List<WmsOdsMateStorageNews> list = wmsOdsMateStorageNewsService.listWmsOdsMateStorageNews(wmsOdsMateStorageNews);
return getDataTable(list);
}
}

@ -151,4 +151,6 @@ public interface OdsProcureOutOrderMapper {
List<OdsProcureOutOrder> CKlist(OdsProcureOutOrder odsProcureOutOrder);
void updateWMSOdsProcureOutOrdersapById(OdsProcureOutOrder order1);
List<OdsProcureOutOrder> listckTS(OdsProcureOutOrder odsProcureOutOrder);
}

@ -76,4 +76,6 @@ public interface IOdsProcureOutOrderService {
List<OdsProcureOutOrder> listReturnSC(OdsProcureOutOrder odsProcureOutOrder);
List<OdsProcureOutOrder> listReturnDY(OdsProcureOutOrder odsProcureOutOrder);
List<OdsProcureOutOrder> listckTS(OdsProcureOutOrder odsProcureOutOrder);
}

@ -62,4 +62,6 @@ public interface IWmsOdsMateStorageNewsService {
String addBS(WmsOdsMateStorageNews wmsOdsMateStorageNews);
List<WmsOdsMateStorageNews> selectWmsOdsMateStorageNewslsList(WmsOdsMateStorageNews wmsOdsMateStorageNews);
List<WmsOdsMateStorageNews> listWmsOdsMateStorageNews(WmsOdsMateStorageNews wmsOdsMateStorageNews);
}

@ -2462,86 +2462,89 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
public String NewConMaterialOutSCNew(List<OdsProcureOutOrder> orderList, List<OdsProcureOutOrder> gzList) {
//orderList标识卡这个要·注意重复过账gzList注意重复过账--就判断是否有对应标识卡未过账,如果未过账就进行过账
String result="操作成功";
String factoryCode = orderList.get(0).getFactoryCode();
DynamicDataSourceContextHolder.push("ds_" + factoryCode);
//我可以在这个循环里面
for (OdsProcureOutOrder odsProcureOutOrder :
orderList) {
//领料单,物料编号,领料单批次,物料名称,托盘号,出库数量,库位号,
String produceCode= odsProcureOutOrder.getProduceCode();//生产领料单号
String createBy= odsProcureOutOrder.getCreateBy();//操作人
String mateOrderInSnId= odsProcureOutOrder.getMateOrderInSnId();
String waCode= odsProcureOutOrder.getWaCode();
String whCode= odsProcureOutOrder.getWhCode();
String wlCode= odsProcureOutOrder.getWlCode();
String sn= odsProcureOutOrder.getSn();
String materialCode= odsProcureOutOrder.getMaterialCode();
String materialDesc= odsProcureOutOrder.getMaterialDesc();
BigDecimal amount= odsProcureOutOrder.getAmount();//数量
String userDefined1= odsProcureOutOrder.getUserDefined1();//单位
String userDefined2= odsProcureOutOrder.getUserDefined2();//批次
//包材明细表
WmsOdsMateStorageNewsSn wmsOdsMateStorageNewsSn = wmsOdsMateStorageNewsSnMapper.selectWmsOdsMateStorageNewsSnByMateOrderInSnIdk(mateOrderInSnId);
//wms_raw_mission_out--保存
//ods_procure_out_order--修改
if(orderList.size()>0){
String factoryCode = orderList.get(0).getFactoryCode();
DynamicDataSourceContextHolder.push("ds_" + factoryCode);
//我可以在这个循环里面
for (OdsProcureOutOrder odsProcureOutOrder :
orderList) {
//领料单,物料编号,领料单批次,物料名称,托盘号,出库数量,库位号,
String produceCode= odsProcureOutOrder.getProduceCode();//生产领料单号
String createBy= odsProcureOutOrder.getCreateBy();//操作人
String mateOrderInSnId= odsProcureOutOrder.getMateOrderInSnId();
String waCode= odsProcureOutOrder.getWaCode();
String whCode= odsProcureOutOrder.getWhCode();
String wlCode= odsProcureOutOrder.getWlCode();
String sn= odsProcureOutOrder.getSn();
String materialCode= odsProcureOutOrder.getMaterialCode();
String materialDesc= odsProcureOutOrder.getMaterialDesc();
BigDecimal amount= odsProcureOutOrder.getAmount();//数量
String userDefined1= odsProcureOutOrder.getUserDefined1();//单位
String userDefined2= odsProcureOutOrder.getUserDefined2();//批次
//包材明细表
WmsOdsMateStorageNewsSn wmsOdsMateStorageNewsSn = wmsOdsMateStorageNewsSnMapper.selectWmsOdsMateStorageNewsSnByMateOrderInSnIdk(mateOrderInSnId);
//wms_raw_mission_out--保存
//ods_procure_out_order--修改
// WCSInventoryPlan wcsInventoryPlan = new WCSInventoryPlan();
// wcsInventoryPlan.setSku(odsProcureOutOrder.getMaterialCode());
// WmsOdsMateStorageNews wmsOdsMateStorageNews = wmsOdsMateStorageNewsMapper.selectBaseProductByCode(wcsInventoryPlan);
OdsProcureOutOrder order = new OdsProcureOutOrder();
order.setProduceCode(produceCode);//领料单
order.setMaterialCode(materialCode);//
order.setMaterialDesc(materialDesc);
order.setUserDefined1(userDefined2);//批次
order.setUserDefined2(whCode);
order.setUserDefined3(wlCode);
order.setSn(sn);
order.setPlanNumber(amount);
order.setLocCode(waCode);//库区
order.setID(IdUtils.fastSimpleUUID());
order.setUnit(userDefined1);
order.setFactoryCode(factoryCode);
order.setActive("1");
order.setCreateBy(createBy);
order.setCreateDate(new Date());
OdsProcureOutOrder odsProcureOutOrder1=new OdsProcureOutOrder();
odsProcureOutOrder1.setProduceCode(produceCode);
odsProcureOutOrder1.setMaterialCode(materialCode);
List<OdsProcureOutOrder> odsProcureOutOrders = odsProcureOutOrderMapper.selectWmsOdsProcureOutOrder(odsProcureOutOrder1);
//包材出库单----会有特殊的那种二次过账的单子--就看前端会不会传对应的标识卡了
OdsProcureOutOrder order1= odsProcureOutOrders.get(0);
order.setUserDefined4(order1.getUserDefined4());
//出库明细
odsProcureOutOrderMapper.insertWmsRawMissionOut(order);
//BigDecimal sapNumber =order1.getSapNumber();
BigDecimal realityNumber1 = order1.getOutNumber();//累出库数
BigDecimal realityNumber = order1.getPlanNumber();//计划
BigDecimal planNumber = amount;//本次实际数量
BigDecimal tem = realityNumber1.add(planNumber);
if (tem.compareTo(realityNumber)>= 0) {
order1.setOrderStatus("3");//3是满足出库数量
} else {
order1.setOrderStatus("2");
}
order1.setOutNumber(tem);//这样的话就可以用已经过账的数量来计算要过账的数量用出库数量减去已经过账的数量就是要过账的数量只要不为0就可以进行
// WmsOdsMateStorageNews wmsOdsMateStorageNews = wmsOdsMateStorageNewsMapper.selectBaseProductByCode(wcsInventoryPlan);
OdsProcureOutOrder order = new OdsProcureOutOrder();
order.setProduceCode(produceCode);//领料单
order.setMaterialCode(materialCode);//
order.setMaterialDesc(materialDesc);
order.setUserDefined1(userDefined2);//批次
order.setUserDefined2(whCode);
order.setUserDefined3(wlCode);
order.setSn(sn);
order.setPlanNumber(amount);
order.setLocCode(waCode);//库区
order.setID(IdUtils.fastSimpleUUID());
order.setUnit(userDefined1);
order.setFactoryCode(factoryCode);
order.setActive("1");
order.setCreateBy(createBy);
order.setCreateDate(new Date());
OdsProcureOutOrder odsProcureOutOrder1=new OdsProcureOutOrder();
odsProcureOutOrder1.setProduceCode(produceCode);
odsProcureOutOrder1.setMaterialCode(materialCode);
List<OdsProcureOutOrder> odsProcureOutOrders = odsProcureOutOrderMapper.selectWmsOdsProcureOutOrder(odsProcureOutOrder1);
//包材出库单----会有特殊的那种二次过账的单子--就看前端会不会传对应的标识卡了
OdsProcureOutOrder order1= odsProcureOutOrders.get(0);
order.setUserDefined4(order1.getUserDefined4());
//出库明细
odsProcureOutOrderMapper.insertWmsRawMissionOut(order);
//BigDecimal sapNumber =order1.getSapNumber();
BigDecimal realityNumber1 = order1.getOutNumber();//累出库数
BigDecimal realityNumber = order1.getPlanNumber();//计划
BigDecimal planNumber = amount;//本次实际数量
BigDecimal tem = realityNumber1.add(planNumber);
if (tem.compareTo(realityNumber)>= 0) {
order1.setOrderStatus("3");//3是满足出库数量
} else {
order1.setOrderStatus("2");
}
order1.setOutNumber(tem);//这样的话就可以用已经过账的数量来计算要过账的数量用出库数量减去已经过账的数量就是要过账的数量只要不为0就可以进行
// order1.setSapNumber(sapNumber.add(planNumber));//原本的过账数量
odsProcureOutOrderMapper.updateWmsOdsProcureOutOrder(order1);//订单修改--会超
//明细
odsProcureOutOrderMapper.updateWmsOdsProcureOutOrder(order1);//订单修改--会超
//明细
// BigDecimal temk= wmsOdsMateStorageNewsSn.getAmount().subtract(amount);
wmsOdsMateStorageNewsSn.setOutNumber(amount);
wmsOdsMateStorageNewsSn.setLastModifiedBy(createBy);
wmsOdsMateStorageNewsSnMapper.updateWmsOdsMateStorageNewsSnAddoutNumber(wmsOdsMateStorageNewsSn);//库存明细--包材库存
WmsOdsEmStorageNews wmsOdsEmStorageNews = new WmsOdsEmStorageNews();
wmsOdsEmStorageNews.setWhCode(wmsOdsMateStorageNewsSn.getWhCode());//仓库编码
wmsOdsEmStorageNews.setWlCode(wmsOdsMateStorageNewsSn.getWlCode());//库位编码
wmsOdsEmStorageNews.setWaCode(wmsOdsMateStorageNewsSn.getWaCode());
wmsOdsEmStorageNews.setProductBatch(wmsOdsMateStorageNewsSn.getUserDefined2());
wmsOdsEmStorageNews.setMaterialCode(wmsOdsMateStorageNewsSn.getMaterialCode());
wmsOdsEmStorageNews.setAmount(odsProcureOutOrder.getPlanNumber());//库存
wmsOdsEmStorageNews.setLastModifiedBy(createBy);
wmsOdsMateStorageNewsSnMapper.updatekdd(wmsOdsEmStorageNews);//库存调整
wmsOdsMateStorageNewsSn.setOutNumber(amount);
wmsOdsMateStorageNewsSn.setLastModifiedBy(createBy);
wmsOdsMateStorageNewsSnMapper.updateWmsOdsMateStorageNewsSnAddoutNumber(wmsOdsMateStorageNewsSn);//库存明细--包材库存
WmsOdsEmStorageNews wmsOdsEmStorageNews = new WmsOdsEmStorageNews();
wmsOdsEmStorageNews.setWhCode(wmsOdsMateStorageNewsSn.getWhCode());//仓库编码
wmsOdsEmStorageNews.setWlCode(wmsOdsMateStorageNewsSn.getWlCode());//库位编码
wmsOdsEmStorageNews.setWaCode(wmsOdsMateStorageNewsSn.getWaCode());
wmsOdsEmStorageNews.setProductBatch(wmsOdsMateStorageNewsSn.getUserDefined2());
wmsOdsEmStorageNews.setMaterialCode(wmsOdsMateStorageNewsSn.getMaterialCode());
wmsOdsEmStorageNews.setAmount(odsProcureOutOrder.getPlanNumber());//库存
wmsOdsEmStorageNews.setLastModifiedBy(createBy);
wmsOdsMateStorageNewsSnMapper.updatekdd(wmsOdsEmStorageNews);//库存调整
}
//
}
//
OdsProcureOutOrder order=new OdsProcureOutOrder();
List<OdsProcureOutOrder> orderList1 = odsProcureOutOrderMapper.selectWmsOdsProcureOutOrderByOrderStatus(order);
@ -2550,6 +2553,10 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
OutboundPostingzcSAPGY(orderList1);
}
if (gzList.size()>0) {
for (OdsProcureOutOrder order1:
gzList) {
System.out.print("---------"+order1.getID());
}
OutboundPostingzcSAPGY(gzList);
// List<OdsProcureOutOrder> odsProcureOutOrders = odsProcureOutOrderMapper.selectWmsOdsProcureOutOrderByIDs(gzList);
// if (odsProcureOutOrders.size()>0){

@ -241,4 +241,11 @@ public class OdsProcureOutOrderServiceImpl implements IOdsProcureOutOrderService
List<OdsProcureOutOrder> orderList = odsProcureOutOrderMapper.selectOdsProcureReturnOrderListZC(odsProcureOutOrder);
return orderList;
}
//特殊出库
@Override
@DS("#header.poolName")
public List<OdsProcureOutOrder> listckTS(OdsProcureOutOrder odsProcureOutOrder) {
List<OdsProcureOutOrder> orderList = odsProcureOutOrderMapper.listckTS(odsProcureOutOrder);
return orderList;
}
}

@ -212,6 +212,11 @@ public class WmsOdsMateStorageNewsServiceImpl implements IWmsOdsMateStorageNewsS
return wmsOdsMateStorageNewsMapper.selectWmsOdsMateStorageNewslsList(wmsOdsMateStorageNews);
}
@Override
public List<WmsOdsMateStorageNews> listWmsOdsMateStorageNews(WmsOdsMateStorageNews wmsOdsMateStorageNews) {
return null;
}
public String dayin( List<OdsProcureOrder> orderList) {
// 定义请求的URL地址
String url = dayinUrl1;

@ -480,10 +480,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsProductPutRecords.setCreateBy(SecurityUtils.getUsername());
wmsProductPutRecords.setCreateTime(new Date());
wmsProductPutRecordsMapper.insertWmsProductPutRecords(wmsProductPutRecords);
WmsFpStorageNews wmsFpStorageNews = new WmsFpStorageNews();
wmsFpStorageNews.setWhCode(mesReportWork.getWhCode());//仓库编码
// wmsFpStorageNews.setWlCode(mesReportWork.getWlCode());
wmsFpStorageNews.setStorageType("成品");

@ -1521,4 +1521,79 @@
set Sap_Number = #{order.sapNumber}
where ID = #{order.ID}
</update>
<select id="listckTS" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
SELECT
Site_code,
ID,
Produce_Code,
Material_Code,
Material_Desc,
Plan_Date,
Plan_Number,
Unit,
COALESCE ( Out_Number, 0 ) AS Out_Number,
Loc_Code,
Loc_Desc,
Production_Line_Desc,
Production_Line_Code,
Order_Status,
User_Defined1,
User_Defined2,
User_Defined3,
User_Defined4,
User_Defined5,
User_Defined6,
User_Defined7,
User_Defined8,
User_Defined9,
User_Defined10,
User_Defined11,
Supplier_Code,
Supplier_Name,
Create_By,
Create_Date,
Last_Update_By,
Last_Update_Date,
Active,
Enterprise_Id,
Enterprise_Code
FROM
wms_ods_procure_out_order_special
<where>
<if test="siteCode != null and siteCode != ''"> and Site_code = #{siteCode}</if>
<if test="produceCode != null and produceCode != ''"> and Produce_Code = #{produceCode}</if>
<if test="materialCode != null and materialCode != ''"> and Material_Code = #{materialCode}</if>
<if test="materialDesc != null and materialDesc != ''"> and Material_Desc = #{materialDesc}</if>
<if test="planDate != null "> and Plan_Date = #{planDate}</if>
<if test="planNumber != null "> and Plan_Number = #{planNumber}</if>
<if test="Unit != null and Unit != ''"> and Unit = #{Unit}</if>
<if test="outNumber != null "> and Out_Number = #{outNumber}</if>
<if test="locCode != null and locCode != ''"> and Loc_Code = #{locCode}</if>
<if test="locDesc != null and locDesc != ''"> and Loc_Desc = #{locDesc}</if>
<if test="productionLineDesc != null and productionLineDesc != ''"> and Production_Line_Desc = #{productionLineDesc}</if>
<if test="productionLineCode != null and productionLineCode != ''"> and Production_Line_Code = #{productionLineCode}</if>
<if test="orderStatus != null and orderStatus != ''"> and Order_Status = #{orderStatus}</if>
<if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if>
<if test="userDefined2 != null and userDefined2 != ''"> and User_Defined2 = #{userDefined2}</if>
<if test="userDefined3 != null and userDefined3 != ''"> and User_Defined3 = #{userDefined3}</if>
<if test="userDefined4 != null and userDefined4 != ''"> and User_Defined4 = #{userDefined4}</if>
<if test="userDefined5 != null and userDefined5 != ''"> and User_Defined5 = #{userDefined5}</if>
<if test="userDefined6 != null and userDefined6 != ''"> and User_Defined6 = #{userDefined6}</if>
<if test="userDefined7 != null and userDefined7 != ''"> and User_Defined7 = #{userDefined7}</if>
<if test="userDefined8 != null and userDefined8 != ''"> and User_Defined8 = #{userDefined8}</if>
<if test="userDefined9 != null and userDefined9 != ''"> and User_Defined9 = #{userDefined9}</if>
<if test="userDefined10 != null and userDefined10 != ''"> and User_Defined10 = #{userDefined10}</if>
<if test="userDefined11 != null and userDefined11 != ''"> and User_Defined11 = #{userDefined11}</if>
<if test="supplierCode != null and supplierCode != ''"> and Supplier_Code = #{supplierCode}</if>
<if test="supplierName != null and supplierName != ''"> and Supplier_Name like concat('%', #{supplierName}, '%')</if>
<if test="createBy != null and createBy != ''"> and Create_By = #{createBy}</if>
<if test="createDate != null "> and Create_Date = #{createDate}</if>
<if test="lastUpdateBy != null and lastUpdateBy != ''"> and Last_Update_By = #{lastUpdateBy}</if>
<if test="lastUpdateDate != null "> and Last_Update_Date = #{lastUpdateDate}</if>
<if test="Active != null and Active != ''"> and Active = #{Active}</if>
<if test="enterpriseId != null and enterpriseId != ''"> and Enterprise_Id = #{enterpriseId}</if>
<if test="enterpriseCode != null and enterpriseCode != ''"> and Enterprise_Code = #{enterpriseCode}</if>
</where>
</select>
</mapper>

Loading…
Cancel
Save