|
|
@@ -9,7 +9,6 @@ import com.steerinfo.meterwork.meterworkcaractualfirst.mapper.MeterWorkCarActual
|
|
|
import com.steerinfo.meterwork.meterworkcaractualfirst.model.MeterWorkCarActualFirst;
|
|
|
import com.steerinfo.meterwork.meterworkznlc.mapper.MeterWorkZnlcMapper;
|
|
|
import com.steerinfo.meterwork.meterworkznlc.service.IMeterWorkZnlcService;
|
|
|
-import com.steerinfo.util.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
@@ -31,20 +30,7 @@ public class MeterWorkZnlcService implements IMeterWorkZnlcService {
|
|
|
MeterWorkCarActualFirstMapper meterWorkCarActualFirstMapper;
|
|
|
|
|
|
@Override
|
|
|
- public RESTfulResult getOldActual(String predictionNo) {
|
|
|
- RESTfulResult rm =new RESTfulResult();
|
|
|
- rm.setSucceed();
|
|
|
- rm.setCode("200");
|
|
|
- rm.setMessage("操作成功!!");
|
|
|
-
|
|
|
- if(StringUtils.isEmpty(predictionNo)) {
|
|
|
- rm.setData(null);
|
|
|
- return rm;
|
|
|
- }
|
|
|
-
|
|
|
- HashMap<String, Object> map = new HashMap<>();
|
|
|
- HashMap<String, Object> param = new HashMap<>();
|
|
|
- map.put("predictionNo", predictionNo);
|
|
|
+ public Boolean getNewActual(RESTfulResult rm, HashMap<String, Object> map, HashMap<String, Object> param) {
|
|
|
|
|
|
//根据委托号查询洁净数据(新系统)
|
|
|
List<MeterWorkCarActual> actualList = meterWorkCarActualMapper.selectByParameters(map);
|
|
|
@@ -58,7 +44,7 @@ public class MeterWorkZnlcService implements IMeterWorkZnlcService {
|
|
|
param.put("MeteringTime", actualList.get(0).getNetTime()); //计量时刻
|
|
|
param.put("MetringPerson", actualList.get(0).getNetManName()); //计量人
|
|
|
rm.setData(param);
|
|
|
- return rm;
|
|
|
+ return true;
|
|
|
}else {
|
|
|
//根据委托号查询一次数据(新系统)
|
|
|
List<MeterWorkCarActualFirst> firstList = meterWorkCarActualFirstMapper.selectByParameters(map);
|
|
|
@@ -73,18 +59,16 @@ public class MeterWorkZnlcService implements IMeterWorkZnlcService {
|
|
|
param.put("MetringPerson", firstList.get(0).getCreateManName()); //计量人
|
|
|
|
|
|
rm.setData(param);
|
|
|
- return rm;
|
|
|
- }else {
|
|
|
- if (oldMetering(rm, map, param)) return rm;
|
|
|
+ return true;
|
|
|
}
|
|
|
}
|
|
|
- return rm;
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
|
|
@TargetDataSource(dataSourceKey = DataSourceKey.DB_SLAVE1)
|
|
|
- public Boolean oldMetering(RESTfulResult rm, HashMap<String, Object> map, HashMap<String, Object> param) {
|
|
|
+ public Boolean getOldActual(RESTfulResult rm, HashMap<String, Object> map, HashMap<String, Object> param) {
|
|
|
List<HashMap> oldActuals = meterWorkZnlcMapper.doQueryActualOld(map);
|
|
|
if(oldActuals.size() >= 1) {
|
|
|
param.put("DeviceNo", oldActuals.get(0).get("DEVICENO")); //计量设备号
|
|
|
@@ -96,20 +80,25 @@ public class MeterWorkZnlcService implements IMeterWorkZnlcService {
|
|
|
param.put("MeteringTime", oldActuals.get(0).get("METERINGTIME")); //计量时刻
|
|
|
param.put("MetringPerson", oldActuals.get(0).get("METRINGPERSON")); //计量人
|
|
|
rm.setData(param);
|
|
|
- }else {
|
|
|
- List<HashMap> oldFirsts = meterWorkZnlcMapper.doQueryFirstOld(map);
|
|
|
- param.put("DeviceNo", oldFirsts.get(0).get("DEVICENO")); //计量设备号
|
|
|
- param.put("WeightVoucherNo", oldFirsts.get(0).get("WEIGHTVOUCHERNO")); //检斤委托号
|
|
|
- param.put("ConveyanceNo", oldFirsts.get(0).get("CONVEYANCENO").toString().replaceAll("-", "")); //车牌号
|
|
|
- param.put("GrossWeight", oldFirsts.get(0).get("GROSSWEIGHT")); //过磅量
|
|
|
- param.put("TareWeight", null); //空车重
|
|
|
- param.put("NetWeight", null); //过磅净重
|
|
|
- param.put("MeteringTime", oldFirsts.get(0).get("METERINGTIME")); //计量时刻
|
|
|
- param.put("MetringPerson", "老系统一次"); //计量人
|
|
|
|
|
|
- rm.setData(param);
|
|
|
return true;
|
|
|
}
|
|
|
+ else {
|
|
|
+ List<HashMap> oldFirsts = meterWorkZnlcMapper.doQueryFirstOld(map);
|
|
|
+ if(oldFirsts.size() >= 1) {
|
|
|
+ param.put("DeviceNo", oldFirsts.get(0).get("DEVICENO")); //计量设备号
|
|
|
+ param.put("WeightVoucherNo", oldFirsts.get(0).get("WEIGHTVOUCHERNO")); //检斤委托号
|
|
|
+ param.put("ConveyanceNo", oldFirsts.get(0).get("CONVEYANCENO").toString().replaceAll("-", "")); //车牌号
|
|
|
+ param.put("GrossWeight", oldFirsts.get(0).get("GROSSWEIGHT")); //过磅量
|
|
|
+ param.put("TareWeight", null); //空车重
|
|
|
+ param.put("NetWeight", null); //过磅净重
|
|
|
+ param.put("MeteringTime", oldFirsts.get(0).get("METERINGTIME")); //计量时刻
|
|
|
+ param.put("MetringPerson", "老系统一次"); //计量人
|
|
|
+
|
|
|
+ rm.setData(param);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
return false;
|
|
|
}
|
|
|
}
|