Commit 9a275157 by ice

采购申请下推采购订单,采购订单审核查询库存现有量代码判断修改

parent 57f9610e
...@@ -81,7 +81,7 @@ public class PurOrderHeaderController { ...@@ -81,7 +81,7 @@ public class PurOrderHeaderController {
purOrderLine.setItemId(invItem.getId()); purOrderLine.setItemId(invItem.getId());
} }
if("000000006c60dba1016c60f588e00002".equals(purOrderHeaderPage.getOrderType())) { if("000000006c60dba1016c60f588e00002".equals(purOrderHeaderPage.getOrderType())) {
Integer sumItemIdQuantity = transactionServer.findByOrgIdAndItemId("2c9007626dde3f4f016deda2151f1a42", purOrderLine.getItemId()); Integer sumItemIdQuantity = transactionServer.findByOrgIdAndItemId(purOrderLine.getItemId());
purOrderLine.setAttribute1(String.valueOf(sumItemIdQuantity)); purOrderLine.setAttribute1(String.valueOf(sumItemIdQuantity));
} }
} }
...@@ -140,7 +140,7 @@ public class PurOrderHeaderController { ...@@ -140,7 +140,7 @@ public class PurOrderHeaderController {
List<PurOrderLine> purOrderLineList = purOrderLineService.findOrderLineByHeaderId(purOrderHeader.getId()); List<PurOrderLine> purOrderLineList = purOrderLineService.findOrderLineByHeaderId(purOrderHeader.getId());
for (PurOrderLine purOrderLine : purOrderLineList) { for (PurOrderLine purOrderLine : purOrderLineList) {
Integer quantity = Integer.valueOf(purOrderLine.getQuantity()); Integer quantity = Integer.valueOf(purOrderLine.getQuantity());
Integer newSumQuantity = transactionServer.findByOrgIdAndItemId("2c9007626dde3f4f016deda2151f1a42",purOrderLine.getItemId()); Integer newSumQuantity = transactionServer.findByOrgIdAndItemId(purOrderLine.getItemId());
if(null == purOrderLine.getAttribute1() || "".equals(purOrderLine.getAttribute1())){ if(null == purOrderLine.getAttribute1() || "".equals(purOrderLine.getAttribute1())){
purOrderLineService.updateOrderLineSumQuantity(String.valueOf(newSumQuantity),purOrderLine.getId()); purOrderLineService.updateOrderLineSumQuantity(String.valueOf(newSumQuantity),purOrderLine.getId());
}else { }else {
......
...@@ -111,17 +111,22 @@ public interface InvTransactionMapper{ ...@@ -111,17 +111,22 @@ public interface InvTransactionMapper{
@ResultMap("invtransaction") @ResultMap("invtransaction")
List<InvTransaction> findInInvTran(@Param("headerId")String headerId,@Param("lineId")String lineId); List<InvTransaction> findInInvTran(@Param("headerId")String headerId,@Param("lineId")String lineId);
//查询该组织下的商品库存现有量 // //查询该组织下的商品库存现有量
@Select("SELECT ifnull(sum(i.tx_quantity),0) FROM inv_transaction i ," + // @Select("SELECT ifnull(sum(i.tx_quantity),0) FROM inv_transaction i ," +
"(SELECT inv_id,default_shipping_subinv_id,default_shipping_locator_id " + // "(SELECT inv_id,default_shipping_subinv_id,default_shipping_locator_id " +
"FROM wsh_parameter " + // "FROM wsh_parameter " +
"WHERE org_id = (" + // "WHERE org_id = (" +
"SELECT org_code FROM hr_organization " + // "SELECT org_code FROM hr_organization " +
"WHERE id = #{orgId} )) w " + // "WHERE id = #{orgId} )) w " +
"WHERE " + // "WHERE " +
"i.inv_id = w.inv_id AND i.subinv_id = w.default_shipping_subinv_id AND i.locator_id = w.default_shipping_locator_id " + // "i.inv_id = w.inv_id AND i.subinv_id = w.default_shipping_subinv_id AND i.locator_id = w.default_shipping_locator_id " +
"and item_id = #{itemId}") // "and item_id = #{itemId}")
Integer selectByOrgIdAndItemId(@Param("orgId")String orgId,@Param("itemId")String itemId); // Integer selectByOrgIdAndItemId(@Param("orgId")String orgId,@Param("itemId")String itemId);
//查询物流二号仓的商品库存现有量
@Select("SELECT ifnull(sum(tx_quantity),0) FROM inv_transaction where inv_id = ( " +
"select id from inv_inventory where inv_code = '2') and item_id =#{itemId}")
Integer selectByOrgIdAndItemId(@Param("itemId")String itemId);
@Select("select id from inv_transaction where item_id=#{itemId}") @Select("select id from inv_transaction where item_id=#{itemId}")
public String findIdByItemId(@Param("itemId")String itemId); public String findIdByItemId(@Param("itemId")String itemId);
......
...@@ -320,7 +320,7 @@ public class TransactionServer { ...@@ -320,7 +320,7 @@ public class TransactionServer {
return invTransactionMapper.selectQuantity(source_header_id, source_line_id); return invTransactionMapper.selectQuantity(source_header_id, source_line_id);
} }
public Integer findByOrgIdAndItemId(String orgId,String itemId){ public Integer findByOrgIdAndItemId(String itemId){
return invTransactionMapper.selectByOrgIdAndItemId(orgId, itemId); return invTransactionMapper.selectByOrgIdAndItemId(itemId);
} }
} }
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