Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
# Conflicts:
# ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/vo/ChargingOrderInfoVO.java
New file |
| | |
| | | package com.ruoyi.account.api.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-08-06 |
| | | */ |
| | | @Data |
| | | public class InvoiceInformationVo { |
| | | |
| | | |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "发票类型(1=增值税普通发票,2=增值税专用发票)") |
| | | private String invoiceType; |
| | | |
| | | @ApiModelProperty(value = "发票类型id") |
| | | private Integer invoiceTypeId; |
| | | |
| | | @ApiModelProperty(value = "抬头类型(1=个人,2=企业)") |
| | | private Integer invoicingObjectType; |
| | | |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "纳税识别号") |
| | | private String taxIdentificationNumber; |
| | | |
| | | @ApiModelProperty(value = "公司地址") |
| | | private String companyAddress; |
| | | |
| | | @ApiModelProperty(value = "公司电话") |
| | | private String companyPhone; |
| | | |
| | | @ApiModelProperty(value = "开户银行") |
| | | private String depositBank; |
| | | |
| | | @ApiModelProperty(value = "银行账户") |
| | | private String bankAccount; |
| | | |
| | | @ApiModelProperty(value = "设置默认(0=否,1=是)") |
| | | private Integer isDefault; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | * @param days |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-charging-order-getDailyChargingDegree-strategy/getUtilizationTrend/{days}") |
| | | @PostMapping("/t-charging-order-accounting-strategy/getDailyChargingDegree/{days}") |
| | | R<List<Double>> getDailyChargingDegree(@PathVariable("days") Integer days, @RequestParam("siteIds") Set<Integer> siteIds); |
| | | } |
| | |
| | | @ApiModelProperty(value = "申诉反馈") |
| | | @TableField("feedback") |
| | | private String feedback; |
| | | @TableField(exist = false) |
| | | private String uid; |
| | | |
| | | @ApiModelProperty(value = "反馈人id") |
| | | @TableField("feedback_user_id") |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.MathContext; |
| | | import java.math.RoundingMode; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | chargeMonitoring.setNotCharged(total.size() - charging.size()); |
| | | chargeMonitoring.setRatedPower(ratedPower.setScale(4, RoundingMode.HALF_EVEN)); |
| | | chargeMonitoring.setRealTimePower(realTimePower.setScale(4, RoundingMode.HALF_EVEN)); |
| | | chargeMonitoring.setDemandPowerSatisfactionRate(realTimePower.divide(ratedPower).multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN)); |
| | | |
| | | if(ratedPower.equals(BigDecimal.ZERO)){ |
| | | chargeMonitoring.setDemandPowerSatisfactionRate(BigDecimal.ZERO); |
| | | }else{ |
| | | chargeMonitoring.setDemandPowerSatisfactionRate(realTimePower.divide(ratedPower, new MathContext(2, RoundingMode.HALF_EVEN)) |
| | | .multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN)); |
| | | } |
| | | |
| | | List<String> dates = new ArrayList<>(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MMM-dd"); |
| | | Calendar calendar = Calendar.getInstance(); |
| | |
| | | List<Double> data = chargingOrderAccountingStrategyClient.getDailyChargingDegree(6, siteIds).getData(); |
| | | List<Double> value2 = new ArrayList<>(); |
| | | for (Double datum : data) { |
| | | Double datum1 = new BigDecimal(datum).divide(new BigDecimal(list.size()).multiply(v).multiply(new BigDecimal(24))).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | value2.add(datum1); |
| | | if(list.size() == 0){ |
| | | value2.add(0D); |
| | | }else{ |
| | | Double datum1 = new BigDecimal(datum).divide(new BigDecimal(list.size()).multiply(v).multiply(new BigDecimal(24))).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | value2.add(datum1); |
| | | } |
| | | } |
| | | Map<String, Object> utilizationTrend = new HashMap<>(); |
| | | utilizationTrend.put("date", dates); |
| | |
| | | payOrderChargingInfo.setChargingName(data1.getName()); |
| | | TChargingGun data2 = chargingGunClient.getChargingGunById(byId.getChargingGunId()).getData(); |
| | | payOrderChargingInfo.setGunName(data2.getName()); |
| | | List<TAppUserCar> data3 = appUserCarClient.getCarByIds(Collections.singletonList(byId.getAppUserCarId())).getData(); |
| | | payOrderChargingInfo.setCarNum(data3.get(0).getLicensePlate()); |
| | | if (byId.getAppUserCarId()!=null) { |
| | | List<TAppUserCar> data3 = appUserCarClient.getCarByIds(Collections.singletonList(byId.getAppUserCarId())).getData(); |
| | | payOrderChargingInfo.setCarNum(data3.get(0).getLicensePlate()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.order.api.model.TOrderAppeal; |
| | | import com.ruoyi.order.api.model.*; |
| | | import com.ruoyi.order.api.query.TOrderAppealQuery; |
| | | import com.ruoyi.order.api.vo.TOrderAppealVO; |
| | | import com.ruoyi.order.dto.ManageFeedbackDto; |
| | | import com.ruoyi.order.dto.ManageOrderAppealQuery; |
| | | import com.ruoyi.order.service.TOrderAppealService; |
| | | import com.ruoyi.order.service.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private final TokenService tokenService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | @Resource |
| | | private TChargingOrderService chargingOrderService; |
| | | @Resource |
| | | private TShoppingOrderService shoppingOrderService; |
| | | @Resource |
| | | private TExchangeOrderService exchangeOrderService; |
| | | |
| | | @Resource |
| | | private TVipOrderService vipOrderService; |
| | | |
| | | |
| | | @Autowired |
| | | public TOrderAppealController(TOrderAppealService orderAppealService, TokenService tokenService) { |
| | |
| | | .like(manageOrderAppealQuery.getPhone() != null, TOrderAppeal::getPhone, manageOrderAppealQuery.getPhone()) |
| | | .eq(manageOrderAppealQuery.getOrderType() != null, TOrderAppeal::getOrderType, manageOrderAppealQuery.getOrderType()) |
| | | .in(TOrderAppeal::getOrderType, 1, 2).page(Page.of(manageOrderAppealQuery.getPageCurr(), manageOrderAppealQuery.getPageSize())); |
| | | |
| | | for (TOrderAppeal record : page.getRecords()) { |
| | | record.setUid(record.getId().toString()); |
| | | } |
| | | return R.ok(page); |
| | | |
| | | |
| | | } |
| | | @ApiOperation(tags = {"后台-订单管理-订单申诉"},value = "删除") |
| | | @DeleteMapping (value = "/manage/delete") |
| | | public R<Page<TOrderAppeal>> delete(String ids) { |
| | | orderAppealService.removeBatchByIds(Arrays.asList(ids.split(","))); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(tags = {"后台-订单管理-订单申诉"},value = "后台-订单管理-订单申诉") |
| | |
| | | orderAppeal.setAppUserId(appUserId); |
| | | orderAppeal.setStatus(1); |
| | | orderAppeal.setPhone(data.getPhone()); |
| | | |
| | | if (orderAppeal.getOrderType()==1){ |
| | | TChargingOrder byId = chargingOrderService.getById(orderAppeal.getOrderId()); |
| | | orderAppeal.setCode(byId.getCode()); |
| | | }else if(orderAppeal.getOrderType()==2){ |
| | | TShoppingOrder byId = shoppingOrderService.getById(orderAppeal.getOrderId()); |
| | | orderAppeal.setCode(byId.getCode()); |
| | | }else if(orderAppeal.getOrderType()==3){ |
| | | TExchangeOrder byId = exchangeOrderService.getById(orderAppeal.getOrderId()); |
| | | orderAppeal.setCode(byId.getCode()); |
| | | }else if(orderAppeal.getOrderType()==4){ |
| | | TVipOrder byId = vipOrderService.getById(orderAppeal.getOrderId()); |
| | | orderAppeal.setCode(byId.getCode()); |
| | | } |
| | | orderAppealService.save(orderAppeal); |
| | | return AjaxResult.success(); |
| | | } |
| | |
| | | private LocalDateTime endTime; |
| | | @ApiModelProperty("支付时间") |
| | | private LocalDateTime payTime; |
| | | private Integer refundStatus; |
| | | private Double finalAmount; |
| | | |
| | | } |
| | |
| | | map2.put("name", "峰"); |
| | | BigDecimal value2 = list1.stream().filter(s -> orderIds.contains(s.getChargingOrderId()) && s.getType() == 2) |
| | | .map(TChargingOrderAccountingStrategy::getChargingCapacity).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | map1.put("value", value2.setScale(2, RoundingMode.HALF_EVEN)); |
| | | map2.put("value", value2.setScale(2, RoundingMode.HALF_EVEN)); |
| | | datas.add(map2); |
| | | |
| | | Map<String, Object> map3 = new HashMap<>(); |
| | | map3.put("name", "平"); |
| | | BigDecimal value3 = list1.stream().filter(s -> orderIds.contains(s.getChargingOrderId()) && s.getType() == 3) |
| | | .map(TChargingOrderAccountingStrategy::getChargingCapacity).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | map1.put("value", value3.setScale(2, RoundingMode.HALF_EVEN)); |
| | | map3.put("value", value3.setScale(2, RoundingMode.HALF_EVEN)); |
| | | datas.add(map3); |
| | | |
| | | Map<String, Object> map4 = new HashMap<>(); |
| | | map4.put("name", "谷"); |
| | | BigDecimal value4 = list1.stream().filter(s -> orderIds.contains(s.getChargingOrderId()) && s.getType() == 4) |
| | | .map(TChargingOrderAccountingStrategy::getChargingCapacity).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | map1.put("value", value4.setScale(2, RoundingMode.HALF_EVEN)); |
| | | map4.put("value", value4.setScale(2, RoundingMode.HALF_EVEN)); |
| | | datas.add(map4); |
| | | list2.add(datas); |
| | | } |
| | |
| | | </select> |
| | | <select id="payOrderQuery" resultType="com.ruoyi.order.dto.PayOrderDto"> |
| | | SELECT * FROM (SELECT |
| | | id, |
| | | `code`, |
| | | 1 as type, |
| | | title, |
| | | phone, |
| | | `status`, |
| | | order_amount, |
| | | payment_amount , |
| | | create_time, |
| | | end_time, |
| | | pay_time |
| | | FROM |
| | | charging_pile_order.t_charging_order UNION ALL |
| | | SELECT |
| | | id, |
| | | `code`, |
| | | 2 as type, |
| | | title, |
| | | phone, |
| | | `status`, |
| | | order_amount, |
| | | payment_amount , |
| | | create_time, |
| | | receiving_time as end_time, |
| | | pay_time |
| | | FROM |
| | | charging_pile_order.t_shopping_order UNION ALL |
| | | SELECT |
| | | id, |
| | | `code`, |
| | | 3 as type, |
| | | title, |
| | | phone, |
| | | payment_status AS `status`, |
| | | order_amount, |
| | | payment_amount , |
| | | create_time, |
| | | create_time as end_time, |
| | | pay_time |
| | | FROM |
| | | charging_pile_order.t_vip_order UNION ALL |
| | | SELECT |
| | | id, |
| | | `code`, |
| | | 4 as type, |
| | | title, |
| | | phone, |
| | | `status`, |
| | | order_amount , |
| | | order_amount as payment_amount, |
| | | create_time, |
| | | out_parking_time as end_time, |
| | | out_parking_time as pay_time |
| | | FROM |
| | | charging_pile_service.t_parking_record ) o |
| | | id, |
| | | `code`, |
| | | 1 as type, |
| | | title, |
| | | phone, |
| | | `status`, |
| | | order_amount, |
| | | payment_amount , |
| | | create_time, |
| | | end_time, |
| | | pay_time, |
| | | refund_status, |
| | | (payment_amount-refund_amount) as final_amount, |
| | | del_flag |
| | | FROM |
| | | charging_pile_order.t_charging_order UNION ALL |
| | | SELECT |
| | | id, |
| | | `code`, |
| | | 2 as type, |
| | | title, |
| | | phone, |
| | | `status`, |
| | | order_amount, |
| | | payment_amount , |
| | | create_time, |
| | | receiving_time as end_time, |
| | | pay_time, |
| | | refund_status, |
| | | (payment_amount-refund_amount) as final_amount, |
| | | del_flag |
| | | FROM |
| | | charging_pile_order.t_shopping_order UNION ALL |
| | | SELECT |
| | | id, |
| | | `code`, |
| | | 3 as type, |
| | | title, |
| | | phone, |
| | | payment_status AS `status`, |
| | | order_amount, |
| | | payment_amount , |
| | | create_time, |
| | | create_time as end_time, |
| | | pay_time, |
| | | refund_status, |
| | | (payment_amount-refund_amount) as final_amount, |
| | | del_flag |
| | | FROM |
| | | charging_pile_order.t_vip_order UNION ALL |
| | | SELECT |
| | | id, |
| | | `code`, |
| | | 4 as type, |
| | | title, |
| | | phone, |
| | | `status`, |
| | | order_amount , |
| | | order_amount as payment_amount, |
| | | create_time, |
| | | out_parking_time as end_time, |
| | | out_parking_time as pay_time, |
| | | null as refund_status, |
| | | 0 as final_amount, |
| | | 0 as del_flag |
| | | FROM |
| | | charging_pile_service.t_parking_record ) o |
| | | <where> |
| | | o.del_flag = 0 |
| | | <if test="data.code != null and data.code != ''"> |
| | | AND o.code LIKE CONCAT('%',#{data.code},'%') |
| | | </if> |
| | |
| | | <if test="data.type != null"> |
| | | AND o.type = #{data.type} |
| | | </if> |
| | | <if test="data.status != null"> |
| | | AND o.status = #{data.status} |
| | | </if> |
| | | |
| | | <if test="data.createTime1 != null"> |
| | | AND o.create_time >= #{data.createTime1} |
| | | </if> |
| | |
| | | AND o.create_time <= #{data.createTime2} |
| | | </if> |
| | | </where> |
| | | |
| | | ORDER BY o.create_time desc |
| | | |
| | | </select> |
| | | <select id="getRefundList" resultType="com.ruoyi.order.api.model.TChargingOrderRefund"> |