Commit d3d32bd2 by 高晓磊

入库的预警设置获取不到service

parent 8514b7b9
...@@ -2,6 +2,7 @@ package com.xyst.dinas.sales.processor; ...@@ -2,6 +2,7 @@ package com.xyst.dinas.sales.processor;
import java.util.UUID; import java.util.UUID;
import com.beecode.amino.core.Amino;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import com.beecode.bcp.type.KObject; import com.beecode.bcp.type.KObject;
...@@ -36,7 +37,11 @@ public class StockAmountWarnCalculate implements IWarningCalculator{ ...@@ -36,7 +37,11 @@ public class StockAmountWarnCalculate implements IWarningCalculator{
UUID stationId = warnSetting.getBillId(); UUID stationId = warnSetting.getBillId();
String dinasTypeName = warnSetting.getTarget(); String dinasTypeName = warnSetting.getTarget();
if(min==null || min.trim().length()==0) return false; if(min==null || min.trim().length()==0) return false;
if(stationService==null){
stationService= Amino.getApplicationContext().getBean(StationService.class);
}
KObject station = stationService.getById(stationId); KObject station = stationService.getById(stationId);
if (stockAmount < Double.valueOf(min)) { if (stockAmount < Double.valueOf(min)) {
warnMessage = station.getString("stationName") + "的"+dinasTypeName+"库存不足"+min+"吨,请注意。"; warnMessage = station.getString("stationName") + "的"+dinasTypeName+"库存不足"+min+"吨,请注意。";
return true; return true;
......
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 to comment