|
@@ -4,12 +4,14 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.steerinfo.dil.feign.OmsFeign;
|
|
|
import com.steerinfo.dil.feign.TmstruckFeign;
|
|
|
import com.steerinfo.dil.mapper.*;
|
|
|
+import com.steerinfo.dil.model.OmstruckOrder;
|
|
|
import com.steerinfo.dil.model.TmstruckReceiveResult;
|
|
|
import com.steerinfo.dil.model.TmstruckWeightResult;
|
|
|
import com.steerinfo.dil.service.ITmstruckWeightResultService;
|
|
|
import com.steerinfo.dil.util.DataChange;
|
|
|
import com.steerinfo.dil.util.newFileTool;
|
|
|
import org.apache.commons.lang.time.FastDateFormat;
|
|
|
+import org.apache.ibatis.exceptions.TooManyResultsException;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -60,6 +62,9 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
@Autowired
|
|
|
TmstruckReceiveResultMapper tmstruckReceiveResultMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ OmstruckOrderMapper omstruckOrderMapper;
|
|
|
+
|
|
|
|
|
|
@Autowired
|
|
|
TmstrainWeightResultServiceImpl tmstrainWeightResultService;
|
|
@@ -1014,6 +1019,31 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
return "success";
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public String changeOrderNumber(Map<String,Object> map) throws Exception{
|
|
|
+ //校验
|
|
|
+ if(map==null || map.get("capacityNumber")==null){
|
|
|
+ throw new Exception("缺乏车牌号:capacityNumber");
|
|
|
+ }
|
|
|
+ //查询车辆对应订单信息
|
|
|
+ Map<String,Object> details = null;
|
|
|
+ try{
|
|
|
+ details = omstruckOrderMapper.findOrderDetailByCapacityNumber(map);
|
|
|
+ }catch (TooManyResultsException e){
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new Exception("查询到多个实绩");
|
|
|
+ }
|
|
|
+ if(details==null || details.get("orderId")==null){
|
|
|
+ throw new Exception("没有查询到正在执行的运单!");
|
|
|
+ }
|
|
|
+ //生成新的运输订单号
|
|
|
+ BigDecimal orderId=omstruckOrderMapper.selectMaxId();
|
|
|
+ String result=DataChange.generateEightDigitsNumber("WYSDD", orderId.intValue());
|
|
|
+ //更新
|
|
|
+ OmstruckOrder omstruckOrder=new OmstruckOrder();
|
|
|
+ omstruckOrder.setOrderId(DataChange.dataToBigDecimal(details.get("orderId")));
|
|
|
+ omstruckOrder.setOrderNumber(result);
|
|
|
+ omstruckOrderMapper.updateByPrimaryKeySelective(omstruckOrder);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|