|
@@ -121,7 +121,6 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
*/
|
|
*/
|
|
public TmstruckWeightResult generateWeightResult(Map<String, Object> map) throws Exception {
|
|
public TmstruckWeightResult generateWeightResult(Map<String, Object> map) throws Exception {
|
|
TmstruckWeightResult tmstruckWeightResult = new TmstruckWeightResult();
|
|
TmstruckWeightResult tmstruckWeightResult = new TmstruckWeightResult();
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
tmstruckWeightResult.setId(DataChange.dataToBigDecimal(map.get("weightTaskResultId")));
|
|
tmstruckWeightResult.setId(DataChange.dataToBigDecimal(map.get("weightTaskResultId")));
|
|
BigDecimal orderType = DataChange.dataToBigDecimal(map.get("orderTypee"));
|
|
BigDecimal orderType = DataChange.dataToBigDecimal(map.get("orderTypee"));
|
|
//磅单号
|
|
//磅单号
|
|
@@ -132,23 +131,10 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
if("56789".contains(orderType.toString())
|
|
if("56789".contains(orderType.toString())
|
|
|| orderType.intValue() == 12
|
|
|| orderType.intValue() == 12
|
|
|| orderType.intValue() == 14
|
|
|| orderType.intValue() == 14
|
|
- || orderType.intValue() == 10){
|
|
|
|
|
|
+ ){
|
|
//如果毛重数据为空 则是第一次计量为毛重 此时第一次计量时间放皮重时间里面
|
|
//如果毛重数据为空 则是第一次计量为毛重 此时第一次计量时间放皮重时间里面
|
|
if(resultCrossWeightTime == null || resultCrossWeightTime.length() == 0){
|
|
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")); //毛重路段顺序
|
|
map.put("segmentSqe", map.get("grossSegmentSqe")); //毛重路段顺序
|
|
utilsService.updateOrderLineSequence(map);
|
|
utilsService.updateOrderLineSequence(map);
|
|
@@ -165,7 +151,43 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
autoReceipt(orderNumber);
|
|
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); //添加计量实绩数据
|
|
addWeightResult(tmstruckWeightResult, map); //添加计量实绩数据
|
|
// 更新订单中路段顺序号,如果毛重时间为空则为计皮:也就是销售第一次计皮,反之有毛重时间则为计毛
|
|
// 更新订单中路段顺序号,如果毛重时间为空则为计皮:也就是销售第一次计皮,反之有毛重时间则为计毛
|
|
if(resultCrossWeightTime == null || resultCrossWeightTime.length() == 0){
|
|
if(resultCrossWeightTime == null || resultCrossWeightTime.length() == 0){
|
|
@@ -178,6 +200,29 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
return tmstruckWeightResult;
|
|
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
|
|
* @param tmstruckWeightResult
|
|
@@ -302,7 +347,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
//设置毛重时间
|
|
//设置毛重时间
|
|
String firstTime = (String) map.get("resultTareWeightTime");
|
|
String firstTime = (String) map.get("resultTareWeightTime");
|
|
tmstrainWeightResult.setResultGrossWeightTime(sdf.parse(firstTime));
|
|
tmstrainWeightResult.setResultGrossWeightTime(sdf.parse(firstTime));
|
|
- //添加毛重汽车衡
|
|
|
|
|
|
+ //添加毛重轨道衡
|
|
Integer tareId = tmstruckWeightResultMapper.selectTruckCalculateId((String) map.get("resultTareCalculateNumber"));
|
|
Integer tareId = tmstruckWeightResultMapper.selectTruckCalculateId((String) map.get("resultTareCalculateNumber"));
|
|
if(tareId == null){
|
|
if(tareId == null){
|
|
throw new Exception("没有此计量衡:" + map.get("resultTareCalculateNumber"));
|
|
throw new Exception("没有此计量衡:" + map.get("resultTareCalculateNumber"));
|
|
@@ -314,13 +359,13 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
tmstrainWeightResult.setInsertTime(new Date());
|
|
tmstrainWeightResult.setInsertTime(new Date());
|
|
tmstrainWeightResult.setInsertUsername("admin");
|
|
tmstrainWeightResult.setInsertUsername("admin");
|
|
}else {
|
|
}else {
|
|
- //设置皮重汽车衡
|
|
|
|
|
|
+ //设置皮重轨道衡
|
|
Integer tareId = tmstruckWeightResultMapper.selectTruckCalculateId((String) map.get("resultTareCalculateNumber"));
|
|
Integer tareId = tmstruckWeightResultMapper.selectTruckCalculateId((String) map.get("resultTareCalculateNumber"));
|
|
if(tareId == null){
|
|
if(tareId == null){
|
|
throw new Exception("没有此计量衡:" + map.get("resultTareCalculateNumber"));
|
|
throw new Exception("没有此计量衡:" + map.get("resultTareCalculateNumber"));
|
|
}
|
|
}
|
|
tmstrainWeightResult.setResultTarePlaceId(new BigDecimal(tareId));
|
|
tmstrainWeightResult.setResultTarePlaceId(new BigDecimal(tareId));
|
|
- //设置毛重汽车衡
|
|
|
|
|
|
+ //设置毛重轨道衡
|
|
Integer crossId = tmstruckWeightResultMapper.selectTruckCalculateId((String) map.get("resultCrossCalculateNumber"));
|
|
Integer crossId = tmstruckWeightResultMapper.selectTruckCalculateId((String) map.get("resultCrossCalculateNumber"));
|
|
if(crossId == null){
|
|
if(crossId == null){
|
|
throw new Exception("没有此计量衡:" + map.get("resultCrossCalculateNumber"));
|
|
throw new Exception("没有此计量衡:" + map.get("resultCrossCalculateNumber"));
|