价格问题

test
anthonywj 2 years ago
parent 8f3f7abf94
commit 2702e27fa0

@ -598,9 +598,9 @@ public class IoCodeTempController extends BaseController {
if (IntUtil.value(priceFifo) > 0) { if (IntUtil.value(priceFifo) > 0) {
if (bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { if (bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
//1.获取当前批次已出库数量 //1.获取当前批次已出库数量
Integer outCount = invProductDetailService.selectCountByInBatch(bussinessTypeEntity, exitLocalEntity.getInBatchNo(), ConstantType.TYPE_OUT); Integer outCount = invProductDetailService.selectCountByInBatch(exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), bussinessTypeEntity, exitLocalEntity.getInBatchNo(), exitLocalEntity.getInvCode(),ConstantType.TYPE_OUT);
//2.获取当前批次入库数量 //2.获取当前批次入库数量
Integer inCount = invProductDetailService.selectCountByInBatch(bussinessTypeEntity, exitLocalEntity.getInBatchNo(), ConstantType.TYPE_PUT); Integer inCount = invProductDetailService.selectCountByInBatch(exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), bussinessTypeEntity, exitLocalEntity.getInBatchNo(),exitLocalEntity.getInvCode(), ConstantType.TYPE_PUT);
if ((IntUtil.value(inCount) - IntUtil.value(outCount) - IntUtil.value(exitLocalEntity.getReCount())) < 0) { if ((IntUtil.value(inCount) - IntUtil.value(outCount) - IntUtil.value(exitLocalEntity.getReCount())) < 0) {
InvProductDetailEntity nextInvProduct = invProductDetailService.selectNextInBatch(bussinessTypeEntity, exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), exitLocalEntity.getInvCode(), ConstantType.TYPE_PUT, exitLocalEntity.getInBatchNo()); InvProductDetailEntity nextInvProduct = invProductDetailService.selectNextInBatch(bussinessTypeEntity, exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), exitLocalEntity.getInvCode(), ConstantType.TYPE_PUT, exitLocalEntity.getInBatchNo());
if (nextInvProduct != null) { if (nextInvProduct != null) {
@ -610,6 +610,8 @@ public class IoCodeTempController extends BaseController {
update = false; update = false;
} }
} }
// checkPrice();
} }
} }
if (update) { if (update) {

@ -61,7 +61,7 @@ public interface InvPreInProductDetailDao extends BaseMapperPlus<InvPreInProduct
InvProductDetailEntity selectFirstInBatch(@Param("relId") String relId, @Param("batchNo") String batchNo, @Param("mainAction") String mainAction); InvProductDetailEntity selectFirstInBatch(@Param("relId") String relId, @Param("batchNo") String batchNo, @Param("mainAction") String mainAction);
Integer selectCountByInBatch(@Param("inBatchNo") String inBatchNo, @Param("mainAction") String mainAction); Integer selectCountByInBatch(@Param("relId") String relId, @Param("batchNo") String batchNo,@Param("inBatchNo") String inBatchNo, @Param("mainAction") String mainAction);
InvProductDetailEntity selectNextInBatch(@Param("relId") String relId, @Param("batchNo") String batchNo, @Param("mainAction") String mainAction, @Param("inBatchNo") String inBatchNo); InvProductDetailEntity selectNextInBatch(@Param("relId") String relId, @Param("batchNo") String batchNo, @Param("mainAction") String mainAction, @Param("inBatchNo") String inBatchNo);

@ -57,7 +57,7 @@ public interface InvPreProductDetailDao extends BaseMapperPlus<InvPreProductDeta
InvProductDetailEntity selectFirstInBatch(@Param("relId") String relId, @Param("batchNo") String batchNo, @Param("mainAction") String mainAction); InvProductDetailEntity selectFirstInBatch(@Param("relId") String relId, @Param("batchNo") String batchNo, @Param("mainAction") String mainAction);
Integer selectCountByInBatch(@Param("inBatchNo") String inBatchNo, @Param("mainAction") String mainAction); Integer selectCountByInBatch(@Param("relId") String relId, @Param("batchNo") String batchNo,@Param("inBatchNo") String inBatchNo, @Param("mainAction") String mainAction);
InvProductDetailEntity selectNextInBatch(@Param("relId") String relId, @Param("batchNo") String batchNo, @Param("mainAction") String mainAction, @Param("inBatchNo") String inBatchNo); InvProductDetailEntity selectNextInBatch(@Param("relId") String relId, @Param("batchNo") String batchNo, @Param("mainAction") String mainAction, @Param("inBatchNo") String inBatchNo);

@ -109,7 +109,7 @@ public interface InvProductDetailDao extends BaseMapperPlus<InvProductDetailDao,
InvProductDetailEntity selectFirstInBatch(@Param("relId") String relId, @Param("batchNo") String batchNo, @Param("invCode") String invCode, @Param("mainAction") String mainAction); InvProductDetailEntity selectFirstInBatch(@Param("relId") String relId, @Param("batchNo") String batchNo, @Param("invCode") String invCode, @Param("mainAction") String mainAction);
Integer selectCountByInBatch(@Param("inBatchNo") String inBatchNo, @Param("mainAction") String mainAction); Integer selectCountByInBatch(@Param("relId") String relId, @Param("batchNo") String batchNo, @Param("invCode") String invCode, @Param("inBatchNo") String inBatchNo, @Param("mainAction") String mainAction);
InvProductDetailEntity selectNextInBatch(@Param("relId") String relId, @Param("batchNo") String batchNo, @Param("invCode") String invCode, @Param("mainAction") String mainAction, @Param("inBatchNo") String inBatchNo); InvProductDetailEntity selectNextInBatch(@Param("relId") String relId, @Param("batchNo") String batchNo, @Param("invCode") String invCode, @Param("mainAction") String mainAction, @Param("inBatchNo") String inBatchNo);

@ -1141,9 +1141,9 @@ public class IoAddInoutService {
} else { } else {
//非首次出库 //非首次出库
//1.获取当前批次已出库数量 //1.获取当前批次已出库数量
Integer outCount = IntUtil.value(invProductDetailService.selectCountByInBatch(bussinessTypeEntity, lastInBatch, ConstantType.TYPE_OUT)); Integer outCount = IntUtil.value(invProductDetailService.selectCountByInBatch(codeTempEntity.getRelId() + "", codeTempEntity.getBatchNo(), bussinessTypeEntity, lastInBatch,codeTempEntity.getInvCode(), ConstantType.TYPE_OUT));
//2.获取当前批次入库数量 //2.获取当前批次入库数量
Integer inCount = IntUtil.value(invProductDetailService.selectCountByInBatch(bussinessTypeEntity, lastInBatch, ConstantType.TYPE_PUT)); Integer inCount = IntUtil.value(invProductDetailService.selectCountByInBatch(codeTempEntity.getRelId() + "", codeTempEntity.getBatchNo(), bussinessTypeEntity, lastInBatch,codeTempEntity.getInvCode(), ConstantType.TYPE_PUT));
//3.若数量还有剩,则此次出库为当前批次 //3.若数量还有剩,则此次出库为当前批次
if (inCount >= (outCount + extiReCount + codeTempEntity.getReCount())) { if (inCount >= (outCount + extiReCount + codeTempEntity.getReCount())) {
codeTempEntity.setPrice(lastList.get(0).getPrice()); codeTempEntity.setPrice(lastList.get(0).getPrice());

@ -267,13 +267,13 @@ public class InvProductDetailService extends ServiceImpl<InvProductDetailDao, In
} }
public Integer selectCountByInBatch(BasicBussinessTypeEntity bussinessTypeEntity, String inBatchNo, String mainAction) { public Integer selectCountByInBatch(String relId, String batchNo, BasicBussinessTypeEntity bussinessTypeEntity, String inBatchNo, String invCode, String mainAction) {
if (bussinessTypeEntity.isScanPreIn()) { //校验预验收库存 if (bussinessTypeEntity.isScanPreIn()) { //校验预验收库存
return invPreInProductDetailDao.selectCountByInBatch(inBatchNo, mainAction); return invPreInProductDetailDao.selectCountByInBatch(relId, batchNo, inBatchNo, mainAction);
} else if (bussinessTypeEntity.isAdvancePreIn()) { //校验寄售库存 } else if (bussinessTypeEntity.isAdvancePreIn()) { //校验寄售库存
return invPreProductDetailDao.selectCountByInBatch(inBatchNo, mainAction); return invPreProductDetailDao.selectCountByInBatch(relId, batchNo, inBatchNo, mainAction);
} else { } else {
return invProductDetailDao.selectCountByInBatch(inBatchNo, mainAction); return invProductDetailDao.selectCountByInBatch(relId, batchNo, invCode, inBatchNo, mainAction);
} }
} }

@ -4,9 +4,9 @@ server:
spring: spring:
datasource: datasource:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver driver-class-name: com.p6spy.engine.spy.P6SpyDriver
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_pt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true jdbc-url: jdbc:p6spy:mysql://192.168.0.242:3306/phxyy_wms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root username: root
password: 123456 password: Glxp@6066
hikari: hikari:
connection-timeout: 60000 connection-timeout: 60000
maximum-pool-size: 20 maximum-pool-size: 20

@ -391,12 +391,21 @@
select sum(reCount) select sum(reCount)
from inv_prein_product_detail from inv_prein_product_detail
<where> <where>
<if test="relId != null and relId != ''">
AND relId = #{relId}
</if>
<if test="inBatchNo != null and inBatchNo != ''"> <if test="inBatchNo != null and inBatchNo != ''">
AND inBatchNo = #{inBatchNo} AND inBatchNo = #{inBatchNo}
</if> </if>
<if test="mainAction != null and mainAction != ''"> <if test="mainAction != null and mainAction != ''">
AND mainAction = #{mainAction} AND mainAction = #{mainAction}
</if> </if>
<if test="batchNo != null and batchNo != ''">
AND batchNo = #{batchNo}
</if>
<if test="batchNo == null or batchNo == ''">
AND batchNo is null
</if>
</where> </where>
</select> </select>

@ -357,12 +357,21 @@
select sum(reCount) select sum(reCount)
from inv_pre_product_detail from inv_pre_product_detail
<where> <where>
<if test="relId != null and relId != ''">
AND relId = #{relId}
</if>
<if test="inBatchNo != null and inBatchNo != ''"> <if test="inBatchNo != null and inBatchNo != ''">
AND inBatchNo = #{inBatchNo} AND inBatchNo = #{inBatchNo}
</if> </if>
<if test="mainAction != null and mainAction != ''"> <if test="mainAction != null and mainAction != ''">
AND mainAction = #{mainAction} AND mainAction = #{mainAction}
</if> </if>
<if test="batchNo != null and batchNo != ''">
AND batchNo = #{batchNo}
</if>
<if test="batchNo == null or batchNo == ''">
AND batchNo is null
</if>
</where> </where>
</select> </select>
@ -387,6 +396,4 @@
LIMIT 1 LIMIT 1
</where> </where>
</select> </select>
</mapper> </mapper>

@ -461,12 +461,24 @@
select sum(reCount) select sum(reCount)
from inv_product_detail from inv_product_detail
<where> <where>
<if test="relId != null and relId != ''">
AND relId = #{relId}
</if>
<if test="invCode != null and invCode != ''">
AND invCode = #{invCode}
</if>
<if test="inBatchNo != null and inBatchNo != ''"> <if test="inBatchNo != null and inBatchNo != ''">
AND inBatchNo = #{inBatchNo} AND inBatchNo = #{inBatchNo}
</if> </if>
<if test="mainAction != null and mainAction != ''"> <if test="mainAction != null and mainAction != ''">
AND mainAction = #{mainAction} AND mainAction = #{mainAction}
</if> </if>
<if test="batchNo != null and batchNo != ''">
AND batchNo = #{batchNo}
</if>
<if test="batchNo == null or batchNo == ''">
AND batchNo is null
</if>
</where> </where>
</select> </select>

Loading…
Cancel
Save