|
|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.nov.KgLowDurable.service.Impl; |
|
|
|
package com.nov.KgLowDurable.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
@ -11,6 +12,7 @@ import com.nov.KgLowDurable.pojo.entity.*; |
|
|
|
import com.nov.KgLowDurable.service.*; |
|
|
|
import com.nov.KgLowDurable.service.*; |
|
|
|
import com.nov.KgLowDurable.util.Func; |
|
|
|
import com.nov.KgLowDurable.util.Func; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
@ -22,6 +24,7 @@ import java.util.List; |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Chill |
|
|
|
* @author Chill |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
|
@Service |
|
|
|
@AllArgsConstructor |
|
|
|
@AllArgsConstructor |
|
|
|
public class LdTwoInventoryRecordServiceImpl extends ServiceImpl<LdTwoInventoryRecordMapper, LdTwoInventoryRecord> implements ILdTwoInventoryRecordService { |
|
|
|
public class LdTwoInventoryRecordServiceImpl extends ServiceImpl<LdTwoInventoryRecordMapper, LdTwoInventoryRecord> implements ILdTwoInventoryRecordService { |
|
|
|
@ -80,7 +83,9 @@ public class LdTwoInventoryRecordServiceImpl extends ServiceImpl<LdTwoInventoryR |
|
|
|
List<LdTwoOutStorageDetail> ldTwoOutStorageDetailList = twoOutStorageDetailService.selectByTwoOutStorageId(approveDto.getTwoOutStorageId()); |
|
|
|
List<LdTwoOutStorageDetail> ldTwoOutStorageDetailList = twoOutStorageDetailService.selectByTwoOutStorageId(approveDto.getTwoOutStorageId()); |
|
|
|
for (LdTwoOutStorageDetail twoOutStorageDetail : ldTwoOutStorageDetailList) { |
|
|
|
for (LdTwoOutStorageDetail twoOutStorageDetail : ldTwoOutStorageDetailList) { |
|
|
|
if (BatchConstant.CONSUMER.equals(twoOutStorageDetail.getType())) { |
|
|
|
if (BatchConstant.CONSUMER.equals(twoOutStorageDetail.getType())) { |
|
|
|
|
|
|
|
log.info("审批通过后,获取到的二级库存id是:" + twoOutStorageDetail.getTwoInventoryId()); |
|
|
|
LdConsumerForm consumerForm = consumerFormService.getById(twoOutStorageDetail.getTwoInventoryId()); |
|
|
|
LdConsumerForm consumerForm = consumerFormService.getById(twoOutStorageDetail.getTwoInventoryId()); |
|
|
|
|
|
|
|
log.info("获取到的二级库存是:" + JSON.toJSONString(consumerForm)); |
|
|
|
//计算差值
|
|
|
|
//计算差值
|
|
|
|
BigDecimal difference = consumerForm.getNum().subtract(twoOutStorageDetail.getNum()); |
|
|
|
BigDecimal difference = consumerForm.getNum().subtract(twoOutStorageDetail.getNum()); |
|
|
|
consumerForm.setNum(difference); |
|
|
|
consumerForm.setNum(difference); |
|
|
|
|