去掉分批数量的bug
This commit is contained in:
@@ -182,8 +182,6 @@ public class DepotItemController {
|
||||
item.put("Unit", diEx.getMunit());
|
||||
item.put("OperNumber", diEx.getOpernumber());
|
||||
item.put("BasicNumber", diEx.getBasicnumber());
|
||||
//统计该商品已分批出库的总数量-用于订单
|
||||
item.put("finishNumber", depotItemService.getFinishNumber(diEx.getMaterialid(),diEx.getHeaderid()));
|
||||
item.put("UnitPrice", diEx.getUnitprice());
|
||||
item.put("TaxUnitPrice", diEx.getTaxunitprice());
|
||||
item.put("AllPrice", diEx.getAllprice());
|
||||
|
||||
@@ -106,6 +106,4 @@ public interface DepotItemMapperEx {
|
||||
@Param("rows") Integer rows, @Param("pid") Integer pid);
|
||||
|
||||
int findStockWarningCountTotal( @Param("pid") Integer pid);
|
||||
|
||||
BigDecimal getFinishNumber(@Param("mid") Long mid, @Param("linkNumber") String linkNumber);
|
||||
}
|
||||
|
||||
@@ -633,20 +633,6 @@ public class DepotItemService {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计该商品已分批出库的总数量-用于订单
|
||||
* @param mid
|
||||
* @param headerId
|
||||
* @return
|
||||
*/
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public BigDecimal getFinishNumber(Long mid, Long headerId) {
|
||||
DepotHead depotHead =depotHeadMapper.selectByPrimaryKey(headerId);
|
||||
String linkNumber = depotHead.getLinknumber(); //关联单号
|
||||
BigDecimal count = depotItemMapperEx.getFinishNumber(mid, linkNumber);
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 库存统计
|
||||
* @param depotId
|
||||
|
||||
@@ -422,10 +422,4 @@
|
||||
AND ifnull(m.delete_Flag, '0') != '1'
|
||||
AND intype.BasicInNumber > 0
|
||||
</select>
|
||||
|
||||
<select id="getFinishNumber" resultType="java.math.BigDecimal">
|
||||
select sum(BasicNumber) from jsh_depotitem
|
||||
where MaterialId=${mid} and headerId
|
||||
in (select id from jsh_depothead where LinkNumber='${linkNumber}')
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.jsh.erp;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.jsh.erp.datasource.entities.Depot;
|
||||
import com.jsh.erp.service.depot.DepotService;
|
||||
import com.jsh.erp.service.depotItem.DepotItemService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class DepotItemTest {
|
||||
|
||||
@Resource
|
||||
private DepotItemService depotItemService;
|
||||
|
||||
@Test
|
||||
public void getFinishNumber() throws Exception{
|
||||
BigDecimal num = depotItemService.getFinishNumber(568l,238l);
|
||||
log.info("depot result:" + JSON.toJSONString(num));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user