|
@@ -91,10 +91,14 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
* @return
|
|
|
*/
|
|
|
public String addTruckWeightResult(Map<String, Object> map) {
|
|
|
-
|
|
|
- Map<String, Object> stringObjectMap = tmstruckWeightResultMapper.selectTotalIdByOrderNo(map);
|
|
|
+
|
|
|
+ Map<String, Object> stringObjectMap = tmstruckWeightResultMapper.selectWeightIdByOrderId(map);
|
|
|
if(stringObjectMap == null){
|
|
|
- return map.get("orderNumber") + "没有此订单信息或物资信息(" + map.get("materialId") + ")错误";
|
|
|
+
|
|
|
+ stringObjectMap = tmstruckWeightResultMapper.selectTotalIdByOrderNo(map);
|
|
|
+ if(stringObjectMap == null){
|
|
|
+ return map.get("orderNumber") + "没有此订单信息或物资信息(" + map.get("materialId") + ")错误";
|
|
|
+ }
|
|
|
}
|
|
|
map.putAll(stringObjectMap);
|
|
|
TmstruckWeightResult tmstruckWeightResult = null;
|
|
@@ -117,30 +121,20 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
*/
|
|
|
public TmstruckWeightResult generateWeightResult(Map<String, Object> map) throws Exception {
|
|
|
TmstruckWeightResult tmstruckWeightResult = new TmstruckWeightResult();
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
tmstruckWeightResult.setId(DataChange.dataToBigDecimal(map.get("weightTaskResultId")));
|
|
|
BigDecimal orderType = DataChange.dataToBigDecimal(map.get("orderTypee"));
|
|
|
|
|
|
tmstruckWeightResult.setResultPoundNo((String) map.get("resultPoundNo"));
|
|
|
String resultCrossWeightTime = (String) map.get("resultCrossWeightTime");
|
|
|
+ tmstruckWeightResult.setMaterialId(DataChange.dataToBigDecimal(map.get("materialId")));
|
|
|
|
|
|
- if("5678".contains(orderType.toString()) || orderType.intValue() == 12 || orderType.intValue() == 14){
|
|
|
+ if("56789".contains(orderType.toString())
|
|
|
+ || orderType.intValue() == 12
|
|
|
+ || orderType.intValue() == 14
|
|
|
+ ){
|
|
|
|
|
|
if(resultCrossWeightTime == null || resultCrossWeightTime.length() == 0){
|
|
|
-
|
|
|
- String firstTime = (String) map.get("resultTareWeightTime");
|
|
|
- tmstruckWeightResult.setResultGrossWeightTime(sdf.parse(firstTime));
|
|
|
-
|
|
|
- Integer tareId = tmstruckWeightResultMapper.selectTruckCalculateId((String) map.get("resultTareCalculateNumber"));
|
|
|
- if(tareId == null){
|
|
|
- throw new Exception("没有此计量衡:" + map.get("resultTareCalculateNumber"));
|
|
|
- }
|
|
|
- tmstruckWeightResult.setResultGrossPlaceId(new BigDecimal(tareId));
|
|
|
-
|
|
|
- BigDecimal resultTareWeight = DataChange.dataToBigDecimal(map.get("resultTareWeight"));
|
|
|
- tmstruckWeightResult.setResultGrossWeight(resultTareWeight);
|
|
|
- tmstruckWeightResult.setInsertTime(new Date());
|
|
|
- tmstruckWeightResult.setInsertUsername("admin");
|
|
|
+ addMaoWeightResult(tmstruckWeightResult, map);
|
|
|
|
|
|
map.put("segmentSqe", map.get("grossSegmentSqe"));
|
|
|
utilsService.updateOrderLineSequence(map);
|
|
@@ -157,7 +151,43 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
autoReceipt(orderNumber);
|
|
|
}
|
|
|
}
|
|
|
- }else{
|
|
|
+ }
|
|
|
+ else if(orderType.intValue() == 10){
|
|
|
+
|
|
|
+ Integer resultNum = tmstruckWeightResultMapper.selectNoNetWeightResult((String) map.get("orderNumber"));
|
|
|
+ if(resultNum == 2){
|
|
|
+
|
|
|
+ addWeightResult(tmstruckWeightResult, map);
|
|
|
+ if(resultCrossWeightTime == null || resultCrossWeightTime.length() == 0){
|
|
|
+ map.put("segmentSqe", map.get("tareSegmentSqe"));
|
|
|
+ }else{
|
|
|
+ map.put("segmentSqe", map.get("grossSegmentSqe"));
|
|
|
+ }
|
|
|
+ utilsService.updateOrderLineSequence(map);
|
|
|
+ }else{
|
|
|
+
|
|
|
+
|
|
|
+ if(resultCrossWeightTime == null || resultCrossWeightTime.length() == 0){
|
|
|
+ addMaoWeightResult(tmstruckWeightResult, map);
|
|
|
+
|
|
|
+ map.put("segmentSqe", map.get("grossSegmentSqe"));
|
|
|
+ utilsService.updateOrderLineSequence(map);
|
|
|
+ }else {
|
|
|
+ addWeightResult(tmstruckWeightResult, map);
|
|
|
+
|
|
|
+ map.put("segmentSqe", map.get("tareSegmentSqe"));
|
|
|
+ utilsService.updateOrderLineSequence(map);
|
|
|
+ String orderNumber = (String) map.get("orderNumber");
|
|
|
+
|
|
|
+
|
|
|
+ Integer check = utilsMapper.checkoutReceipt(orderNumber);
|
|
|
+ if(check == null){
|
|
|
+ autoReceipt(orderNumber);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
addWeightResult(tmstruckWeightResult, map);
|
|
|
|
|
|
if(resultCrossWeightTime == null || resultCrossWeightTime.length() == 0){
|
|
@@ -170,6 +200,29 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
return tmstruckWeightResult;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * 添加第一次为毛重数据的计量实绩
|
|
|
+ * @param tmstruckWeightResult
|
|
|
+ * @param map
|
|
|
+ */
|
|
|
+ public void addMaoWeightResult(TmstruckWeightResult tmstruckWeightResult, Map<String, Object> map) throws Exception{
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ String firstTime = (String) map.get("resultTareWeightTime");
|
|
|
+ tmstruckWeightResult.setResultGrossWeightTime(sdf.parse(firstTime));
|
|
|
+
|
|
|
+ Integer tareId = tmstruckWeightResultMapper.selectTruckCalculateId((String) map.get("resultTareCalculateNumber"));
|
|
|
+ if(tareId == null){
|
|
|
+ throw new Exception("没有此计量衡:" + map.get("resultTareCalculateNumber"));
|
|
|
+ }
|
|
|
+ tmstruckWeightResult.setResultGrossPlaceId(new BigDecimal(tareId));
|
|
|
+
|
|
|
+ BigDecimal resultTareWeight = DataChange.dataToBigDecimal(map.get("resultTareWeight"));
|
|
|
+ tmstruckWeightResult.setResultGrossWeight(resultTareWeight);
|
|
|
+ tmstruckWeightResult.setInsertTime(new Date());
|
|
|
+ tmstruckWeightResult.setInsertUsername("admin");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
* 添加计量实绩添加数据
|
|
|
* @param tmstruckWeightResult
|
|
@@ -189,7 +242,6 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
tmstruckWeightResult.setResultTarePlaceId(new BigDecimal(tareId));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
|
|
|
String resultCrossCalculateNumber = (String) map.get("resultCrossCalculateNumber");
|
|
|
if(resultCrossCalculateNumber != null){
|
|
@@ -203,15 +255,22 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
}
|
|
|
|
|
|
if(map.get("resultCrossWeight") != null){
|
|
|
- tmstruckWeightResult.setResultGrossWeight(DataChange.dataToBigDecimal(map.get("resultCrossWeight")));
|
|
|
+ String resultCrossWeight = (String) map.get("resultCrossWeight");
|
|
|
+ if(!"".equals(resultCrossWeight))
|
|
|
+ tmstruckWeightResult.setResultGrossWeight(DataChange.dataToBigDecimal(resultCrossWeight));
|
|
|
}
|
|
|
|
|
|
if(map.get("resultTareWeight") != null){
|
|
|
- tmstruckWeightResult.setResultTareWeight(DataChange.dataToBigDecimal(map.get("resultTareWeight")));
|
|
|
+ String resultTareWeight = (String) map.get("resultTareWeight");
|
|
|
+ if(!"".equals(resultTareWeight))
|
|
|
+ tmstruckWeightResult.setResultTareWeight(DataChange.dataToBigDecimal(resultTareWeight));
|
|
|
}
|
|
|
|
|
|
if(map.get("resultNetWeight") != null){
|
|
|
- tmstruckWeightResult.setResultNetWeight(DataChange.dataToBigDecimal(map.get("resultNetWeight")));
|
|
|
+ String resultNetWeight = (String) map.get("resultNetWeight");
|
|
|
+ if(!"".equals(resultNetWeight)){
|
|
|
+ tmstruckWeightResult.setResultNetWeight(DataChange.dataToBigDecimal(resultNetWeight));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if(map.get("resultTareWeightTime") != null){
|
|
@@ -294,7 +353,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
|
|
|
String firstTime = (String) map.get("resultTareWeightTime");
|
|
|
tmstrainWeightResult.setResultGrossWeightTime(sdf.parse(firstTime));
|
|
|
-
|
|
|
+
|
|
|
Integer tareId = tmstruckWeightResultMapper.selectTruckCalculateId((String) map.get("resultTareCalculateNumber"));
|
|
|
if(tareId == null){
|
|
|
throw new Exception("没有此计量衡:" + map.get("resultTareCalculateNumber"));
|
|
@@ -306,13 +365,13 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
tmstrainWeightResult.setInsertTime(new Date());
|
|
|
tmstrainWeightResult.setInsertUsername("admin");
|
|
|
}else {
|
|
|
-
|
|
|
+
|
|
|
Integer tareId = tmstruckWeightResultMapper.selectTruckCalculateId((String) map.get("resultTareCalculateNumber"));
|
|
|
if(tareId == null){
|
|
|
throw new Exception("没有此计量衡:" + map.get("resultTareCalculateNumber"));
|
|
|
}
|
|
|
tmstrainWeightResult.setResultTarePlaceId(new BigDecimal(tareId));
|
|
|
-
|
|
|
+
|
|
|
Integer crossId = tmstruckWeightResultMapper.selectTruckCalculateId((String) map.get("resultCrossCalculateNumber"));
|
|
|
if(crossId == null){
|
|
|
throw new Exception("没有此计量衡:" + map.get("resultCrossCalculateNumber"));
|