|
|
|
|
@ -9,6 +9,8 @@ import com.op.common.core.utils.StringUtils;
|
|
|
|
|
import com.op.common.core.utils.uuid.IdUtils;
|
|
|
|
|
import com.op.common.core.web.domain.AjaxResult;
|
|
|
|
|
import com.op.common.security.utils.SecurityUtils;
|
|
|
|
|
import com.op.device.domain.EquSparepartsInOut;
|
|
|
|
|
import com.op.device.mapper.EquSparepartsInOutMapper;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
@ -35,6 +37,8 @@ import static com.op.common.core.web.domain.AjaxResult.success;
|
|
|
|
|
public class SparePartsLedgerServiceImpl implements ISparePartsLedgerService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private SparePartsLedgerMapper sparePartsLedgerMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private EquSparepartsInOutMapper equSparepartsInOutMapper;
|
|
|
|
|
|
|
|
|
|
protected Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
|
|
|
|
|
@ -59,7 +63,28 @@ public class SparePartsLedgerServiceImpl implements ISparePartsLedgerService {
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public List<SparePartsLedger> selectSparePartsLedgerList(SparePartsLedger sparePartsLedger) {
|
|
|
|
|
return sparePartsLedgerMapper.selectSparePartsLedgerList(sparePartsLedger);
|
|
|
|
|
List<SparePartsLedger> sparePartsLedgerList = sparePartsLedgerMapper.selectSparePartsLedgerList(sparePartsLedger);
|
|
|
|
|
for (int i = 0; i < sparePartsLedgerList.size(); i++) {
|
|
|
|
|
//查询出入库总数
|
|
|
|
|
EquSparepartsInOut sparepartsInOut =new EquSparepartsInOut();
|
|
|
|
|
sparepartsInOut.setSpareCode(sparePartsLedgerList.get(i).getMaterialCode());
|
|
|
|
|
sparepartsInOut=equSparepartsInOutMapper.selectEquSparepartsInOutListSum(sparepartsInOut);
|
|
|
|
|
// 设置入库记录(带非空判断)
|
|
|
|
|
if(sparepartsInOut != null && sparepartsInOut.getInAmount() != null) {
|
|
|
|
|
sparePartsLedgerList.get(i).setInputRecords(String.valueOf(sparepartsInOut.getInAmount()));
|
|
|
|
|
} else {
|
|
|
|
|
sparePartsLedgerList.get(i).setInputRecords("0"); // 默认值
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 设置出库记录(带非空判断)
|
|
|
|
|
if(sparepartsInOut != null && sparepartsInOut.getOutAmount() != null) {
|
|
|
|
|
sparePartsLedgerList.get(i).setOutputRecords(String.valueOf(sparepartsInOut.getOutAmount()));
|
|
|
|
|
} else {
|
|
|
|
|
sparePartsLedgerList.get(i).setOutputRecords("0"); // 默认值
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return sparePartsLedgerList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|