|
@@ -22,10 +22,7 @@ import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
|
import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
|
import com.sckw.transport.dao.*;
|
|
import com.sckw.transport.dao.*;
|
|
|
import com.sckw.transport.model.*;
|
|
import com.sckw.transport.model.*;
|
|
|
-import com.sckw.transport.model.dto.AddressDropListDTO;
|
|
|
|
|
-import com.sckw.transport.model.dto.WayBillDetailDTO;
|
|
|
|
|
-import com.sckw.transport.model.dto.WaybillListAppDTO;
|
|
|
|
|
-import com.sckw.transport.model.dto.WaybillOrderDTO;
|
|
|
|
|
|
|
+import com.sckw.transport.model.dto.*;
|
|
|
import com.sckw.transport.model.vo.*;
|
|
import com.sckw.transport.model.vo.*;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
@@ -960,13 +957,46 @@ public class WaybillManagementService {
|
|
|
*/
|
|
*/
|
|
|
public HttpResult waybillAmountStatistic(WaybillListAppDTO query) {
|
|
public HttpResult waybillAmountStatistic(WaybillListAppDTO query) {
|
|
|
List<Long> _statuses = getWallBillStatues(query.getStatus());
|
|
List<Long> _statuses = getWallBillStatues(query.getStatus());
|
|
|
- Map<String, Object> amount = kwtWaybillOrderMapper.selectWaybillOrderAmountByStatus(
|
|
|
|
|
|
|
+ List<WaybillAmountDTO> wOrders = kwtWaybillOrderMapper.selectWaybillOrdersByStatus(
|
|
|
LoginUserHolder.getEntId(),
|
|
LoginUserHolder.getEntId(),
|
|
|
_statuses,
|
|
_statuses,
|
|
|
query.getKeyword(),
|
|
query.getKeyword(),
|
|
|
StringUtils.isBlank(query.getStartDate()) ? null : query.getStartDate().concat(" 00:00:00"),
|
|
StringUtils.isBlank(query.getStartDate()) ? null : query.getStartDate().concat(" 00:00:00"),
|
|
|
StringUtils.isBlank(query.getEndDate()) ? null : query.getEndDate().concat(" 23:59:59")
|
|
StringUtils.isBlank(query.getEndDate()) ? null : query.getEndDate().concat(" 23:59:59")
|
|
|
);
|
|
);
|
|
|
|
|
+ Map<String, String> amount = new HashMap<>();
|
|
|
|
|
+ // 总计条数
|
|
|
|
|
+ BigDecimal loadAmount = new BigDecimal(Global.AMOUNT);
|
|
|
|
|
+ BigDecimal unloadAmount = new BigDecimal(Global.AMOUNT);
|
|
|
|
|
+ BigDecimal lossAmount = new BigDecimal(Global.AMOUNT);
|
|
|
|
|
+ BigDecimal deficitRealAmount = new BigDecimal(Global.AMOUNT);
|
|
|
|
|
+ if(CollectionUtils.isNotEmpty(wOrders)) {
|
|
|
|
|
+ for (WaybillAmountDTO wOrder:wOrders) {
|
|
|
|
|
+ loadAmount = loadAmount.add(wOrder.getLoadAmount() == null ? new BigDecimal(Global.AMOUNT) : wOrder.getLoadAmount());
|
|
|
|
|
+ unloadAmount = unloadAmount.add(wOrder.getUnloadAmount() == null ? new BigDecimal(Global.AMOUNT) : wOrder.getUnloadAmount());
|
|
|
|
|
+ lossAmount = lossAmount.add(wOrder.getDeficitAmount() == null ? new BigDecimal(Global.AMOUNT) : wOrder.getDeficitAmount());
|
|
|
|
|
+ if(wOrder.getLoadAmount() != null
|
|
|
|
|
+ && wOrder.getUnloadAmount() != null
|
|
|
|
|
+ && wOrder.getDeficitAmount() != null
|
|
|
|
|
+ ) {
|
|
|
|
|
+ BigDecimal realDeficitAMount = commonService.deficitPrice(
|
|
|
|
|
+ wOrder.getLoadAmount(),
|
|
|
|
|
+ wOrder.getDeficitAmount(),
|
|
|
|
|
+ wOrder.getLoss(),
|
|
|
|
|
+ wOrder.getLossUnit()
|
|
|
|
|
+ );
|
|
|
|
|
+ deficitRealAmount = deficitRealAmount.add(realDeficitAMount);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 总计装货量
|
|
|
|
|
+ amount.put("loadAmount", String.valueOf(loadAmount));
|
|
|
|
|
+ // 总计卸货量
|
|
|
|
|
+ amount.put("unloadAmount", String.valueOf(unloadAmount));
|
|
|
|
|
+ // 总计货损量
|
|
|
|
|
+ amount.put("lossAmount", String.valueOf(lossAmount));
|
|
|
|
|
+ // 总计扣亏量
|
|
|
|
|
+ amount.put("deficitRealAmount", String.valueOf(deficitRealAmount));
|
|
|
return HttpResult.ok(amount);
|
|
return HttpResult.ok(amount);
|
|
|
}
|
|
}
|
|
|
|
|
|