|
@@ -300,7 +300,13 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
if(resultCrossWeightTime == null || resultCrossWeightTime.length() == 0){
|
|
if(resultCrossWeightTime == null || resultCrossWeightTime.length() == 0){
|
|
map.put("segmentSqe", map.get("tareSegmentSqe")); //皮重路段顺序
|
|
map.put("segmentSqe", map.get("tareSegmentSqe")); //皮重路段顺序
|
|
}else{
|
|
}else{
|
|
- map.put("segmentSqe", map.get("grossSegmentSqe")); //毛重路段顺序
|
|
|
|
|
|
+ //查询有净重的路段顺序号最大的
|
|
|
|
+ BigDecimal orderLineSqe = tmstruckWeightResultMapper.selectOrderLineSqe(DataChange.dataToBigDecimal(map.get("resultTotalId")));
|
|
|
|
+ if(orderLineSqe != null && orderLineSqe.compareTo(DataChange.dataToBigDecimal(map.get("grossSegmentSqe"))) > 0){
|
|
|
|
+ map.put("segmentSqe",orderLineSqe);
|
|
|
|
+ }else{
|
|
|
|
+ map.put("segmentSqe", map.get("grossSegmentSqe")); //毛重路段顺序
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if(orderType == 1 || orderType == 4){
|
|
if(orderType == 1 || orderType == 4){
|
|
//如果是钢材订单,获取下一个还没计量的实绩 将毛重数据作为下一个计量实绩的皮重
|
|
//如果是钢材订单,获取下一个还没计量的实绩 将毛重数据作为下一个计量实绩的皮重
|
|
@@ -803,8 +809,11 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
tmstruckWeightResultMapper.updateWeightResult(DataChange.dataToBigDecimal(map1.get("weightTaskResultId")));
|
|
tmstruckWeightResultMapper.updateWeightResult(DataChange.dataToBigDecimal(map1.get("weightTaskResultId")));
|
|
tmstruckWeightResultMapper.updateWeightTareNoGross(resultTotalId);
|
|
tmstruckWeightResultMapper.updateWeightTareNoGross(resultTotalId);
|
|
//查询有净重的实绩的最大路段顺序号
|
|
//查询有净重的实绩的最大路段顺序号
|
|
- Integer orderLineSqe = tmstruckWeightResultMapper.selectOrderLineSqe(resultTotalId);
|
|
|
|
- tmstruckWeightResultMapper.updateOrderLineSqeBySqe(orderId,orderLineSqe);
|
|
|
|
|
|
+ BigDecimal orderLineSqe = tmstruckWeightResultMapper.selectOrderLineSqe(resultTotalId);
|
|
|
|
+ if(orderLineSqe != null) {
|
|
|
|
+ tmstruckWeightResultMapper.updateOrderLineSqeBySqe(orderId,orderLineSqe.intValue());
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
@@ -922,4 +931,89 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 计量联动删除方法
|
|
|
|
+ * @param map
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public String linkageDeleteTransportOrder2(Map<String, Object> map) throws Exception{
|
|
|
|
+ try{
|
|
|
|
+ new Thread( new Runnable() {
|
|
|
|
+ public void run(){
|
|
|
|
+ try {
|
|
|
|
+ JSONObject jsonObject = new JSONObject(map);
|
|
|
|
+ newFileTool.newFile(jsonObject.toString(),"计量-物流联动删单");
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }).start();
|
|
|
|
+ }catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ //联动删除
|
|
|
|
+ String poundNo = (String) map.get("poundNo");
|
|
|
|
+ //判断该运输订单号是否是钢材的
|
|
|
|
+ Map<String,Object> orderMes = null;
|
|
|
|
+ try {
|
|
|
|
+ orderMes = tmstruckWeightResultMapper.getOOPoundMes(poundNo);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ return "error:信息错误,该磅单号对应多条实绩.";
|
|
|
|
+ }
|
|
|
|
+ if(orderMes == null) {
|
|
|
|
+ return "error:没有找到对应的单据信息,请核实后再发送";
|
|
|
|
+ }
|
|
|
|
+ BigDecimal resultTotalId = DataChange.dataToBigDecimal(orderMes.get("resultTotalId"));
|
|
|
|
+ BigDecimal orderId = DataChange.dataToBigDecimal(orderMes.get("orderId"));
|
|
|
|
+ Integer orderType = DataChange.dataToBigDecimal(orderMes.get("orderType")).intValue();
|
|
|
|
+ if(orderType == 1 || orderType == 4) {
|
|
|
|
+ //删皮,此时没有物资名称,只有运输订单号
|
|
|
|
+ if(orderMes.get("netWeight") == null || "".equals(orderMes.get("netWeight"))){
|
|
|
|
+ //清空皮重信息,且将进厂时间清空,且将路段顺序号置为0
|
|
|
|
+ tmstruckWeightResultMapper.updateWeightTare(resultTotalId);
|
|
|
|
+ tmstruckWeightResultMapper.updateEnfactoryResult(resultTotalId);
|
|
|
|
+ tmstruckWeightResultMapper.updateOrderLineSqe(orderId);
|
|
|
|
+ tmstruckWeightResultMapper.updateTotalStatus(resultTotalId);
|
|
|
|
+ return "删除皮重信息,同时将进厂信息删除,请提醒司机重新扫进厂,否则不能过磅!";
|
|
|
|
+ }
|
|
|
|
+ //如果传输了物资,则判断该物资是第几拼
|
|
|
|
+ if(orderMes.get("netWeight") != null){
|
|
|
|
+ //查询该物资id及对应的净重还有毛重时间是哪一拼
|
|
|
|
+ //判断该总实绩下净重的条数
|
|
|
|
+ int netWeightCount = tmstruckWeightResultMapper.getNetWeightCount(resultTotalId);
|
|
|
|
+ //根据查询信息判断是哪一拼
|
|
|
|
+ Integer spellNum = (DataChange.dataToBigDecimal(orderMes.get("grossSqe")).intValue() + DataChange.dataToBigDecimal(orderMes.get("tareSqe")).intValue()) / 6;
|
|
|
|
+ if(spellNum == 1){
|
|
|
|
+ //如果是第一拼
|
|
|
|
+ tmstruckWeightResultMapper.updateWeightResult(DataChange.dataToBigDecimal(orderMes.get("weightTaskResultId")));
|
|
|
|
+ }else{
|
|
|
|
+ tmstruckWeightResultMapper.updateWeightResult(DataChange.dataToBigDecimal(orderMes.get("weightTaskResultId")));
|
|
|
|
+ tmstruckWeightResultMapper.updateWeightTareNoGross(resultTotalId);
|
|
|
|
+ //查询有净重的实绩的最大路段顺序号
|
|
|
|
+ BigDecimal orderLineSqe = tmstruckWeightResultMapper.selectOrderLineSqe(resultTotalId);
|
|
|
|
+ if(orderLineSqe != null) {
|
|
|
|
+ tmstruckWeightResultMapper.updateOrderLineSqeBySqe(orderId,orderLineSqe.intValue());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(netWeightCount == 1) {
|
|
|
|
+ //删除下面拼装的皮重
|
|
|
|
+ tmstruckWeightResultMapper.updateWeightTareNoGross(resultTotalId);
|
|
|
|
+ tmstruckWeightResultMapper.updateEnfactoryResult(resultTotalId);
|
|
|
|
+ tmstruckWeightResultMapper.updateOrderLineSqe(orderId);
|
|
|
|
+ tmstruckWeightResultMapper.updateTotalStatus(resultTotalId);
|
|
|
|
+ return "该车整条计量数据1条,删除整条数据1条,同时将进厂信息删除,请提醒司机重新扫进厂,否则不能过磅!";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return "磅单号:" + poundNo + "删除成功" ;
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ return "error:非出厂钢材订单,不能通过该操作删除";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return "success";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|