|
@@ -6,6 +6,7 @@ import com.steerinfo.dil.service.ITmstruckSelfMachineService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -43,26 +44,41 @@ public class TmstruckSelfMachineService implements ITmstruckSelfMachineService {
|
|
|
public Map<String, Object> getDeliveryOrder(String orderNumber) {
|
|
|
//1.根据运输订单号查询主干信息
|
|
|
Map<String,Object> map = tmstruckLeaveFactoryResultMapper.getDeliveryOrder(orderNumber);
|
|
|
+ map.put("note",tmstruckLeaveFactoryResultMapper.querynote(orderNumber));
|
|
|
map.put("orderNumber",orderNumber);
|
|
|
if(map !=null){
|
|
|
List<Map<String, Object>> deliveryOrderMaterialList = tmstruckLeaveFactoryResultMapper.getDeliveryOrderMaterial(orderNumber);
|
|
|
//判断为棒材还是线材
|
|
|
for (Map<String,Object> map1:deliveryOrderMaterialList){
|
|
|
- map1.remove("materialWeight");
|
|
|
+ BigDecimal materialid = (BigDecimal) map1.get("materialid");
|
|
|
String materialName =(String) map1.get("materialName");
|
|
|
map.put("materialName",materialName);
|
|
|
//判断是否为盘螺
|
|
|
- if (materialName.contains("盘螺")){
|
|
|
+ if (materialName.contains("盘螺")||materialName.contains("螺纹钢")||materialName.contains("盘元")){
|
|
|
//根据运输订单号查找实绩重量
|
|
|
- Map<String, Object> netWeight = tmstruckLeaveFactoryResultMapper.getNetWeightByOrder(map);
|
|
|
- String nowNetWeight =(String) netWeight.get("nowNetWeight");
|
|
|
- if (nowNetWeight!=null) {
|
|
|
- map.put("materialWeight", nowNetWeight);
|
|
|
+ List<Map<String, Object>> netWeightlist = tmstruckLeaveFactoryResultMapper.getNetWeightByOrder(map);
|
|
|
+ for (Map<String, Object> stringObjectMap : netWeightlist) {
|
|
|
+ BigDecimal materialid1 = (BigDecimal) stringObjectMap.get("materialid");
|
|
|
+ if (materialid.compareTo(materialid1) == 0) {
|
|
|
+ BigDecimal nowNetWeight = (BigDecimal) stringObjectMap.get("nowNetWeight");
|
|
|
+ if (nowNetWeight != null) {
|
|
|
+ map1.put("materialWeight", nowNetWeight);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}else {
|
|
|
//获取物资理重
|
|
|
- String theoryWeight = tmstruckLeaveFactoryResultMapper.getTheoryWeight(map);
|
|
|
- map.put("materialWeight",theoryWeight);
|
|
|
+ List<Map<String, Object>> theoryWeightlist = tmstruckLeaveFactoryResultMapper.getTheoryWeight(map);
|
|
|
+ for (Map<String, Object> stringObjectMap : theoryWeightlist) {
|
|
|
+ BigDecimal materialid1 = (BigDecimal) stringObjectMap.get("materialid");
|
|
|
+ if (materialid.compareTo(materialid1) == 0){
|
|
|
+ BigDecimal theoryWeight=(BigDecimal) stringObjectMap.get("theoryWeight");
|
|
|
+ if (theoryWeight != null){
|
|
|
+ map1.put("materialWeight",theoryWeight);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
map.put("deliveryOrderMaterialList",deliveryOrderMaterialList);
|