修改首页统计
This commit is contained in:
parent
f5089056b4
commit
5dd38e8974
@ -39,6 +39,7 @@ public interface TIccardDeviceMapper {
|
|||||||
*/
|
*/
|
||||||
void updateCardDeviceStatusIsDel(Integer deviceId);
|
void updateCardDeviceStatusIsDel(Integer deviceId);
|
||||||
|
|
||||||
|
void deleteIccardDeviceId(Integer deviceId);
|
||||||
/**
|
/**
|
||||||
* query specified card grant device delete status
|
* query specified card grant device delete status
|
||||||
*
|
*
|
||||||
|
|||||||
@ -162,6 +162,8 @@ public class XhpcCardServiceImpl implements IXhpcCardService {
|
|||||||
String log = JSONUtil.toJsonStr(deviceLogInfo);
|
String log = JSONUtil.toJsonStr(deviceLogInfo);
|
||||||
tIccardLog.setLog(log);
|
tIccardLog.setLog(log);
|
||||||
tIccardLogMapper.insertSelective(tIccardLog);
|
tIccardLogMapper.insertSelective(tIccardLog);
|
||||||
|
|
||||||
|
tIccardDeviceMapper.deleteIccardDeviceId(deviceId);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
ccu.usersTime as usersTime,
|
ccu.usersTime as usersTime,
|
||||||
ccu.status as status
|
ccu.status as status
|
||||||
from t_iccard_client_users ccu
|
from t_iccard_client_users ccu
|
||||||
join xhpc_operator ope on ope.corp_no = ccu.corpNo
|
join xhpc_operator ope on ope.corp_no = ccu.corpNo and ccu.usersCorp =ope.operator_id
|
||||||
where ccu.del_flag=0
|
where ccu.del_flag=0
|
||||||
<if test="userName !=null and userName !=''">
|
<if test="userName !=null and userName !=''">
|
||||||
and ccu.usersName like concat('%', #{userName}, '%')
|
and ccu.usersName like concat('%', #{userName}, '%')
|
||||||
@ -122,6 +122,7 @@
|
|||||||
<select id="getoperatorList" resultType="map">
|
<select id="getoperatorList" resultType="map">
|
||||||
select
|
select
|
||||||
corp_no as corpNo,
|
corp_no as corpNo,
|
||||||
|
operator_id usersCorp,
|
||||||
name as name
|
name as name
|
||||||
from xhpc_operator where tenant_id=#{tenantId} and del_flag =0
|
from xhpc_operator where tenant_id=#{tenantId} and del_flag =0
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@ -131,9 +131,14 @@
|
|||||||
tenant_id = #{tenantId,jdbcType=VARCHAR}
|
tenant_id = #{tenantId,jdbcType=VARCHAR}
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</update>
|
</update>
|
||||||
<update id="updateCardDeviceStatusIsDel">
|
<delete id="updateCardDeviceStatusIsDel">
|
||||||
update t_iccard_device
|
update t_iccard_device
|
||||||
set del_flag = 1
|
set del_flag = 1
|
||||||
where id = #{deviceId}
|
where id = #{deviceId}
|
||||||
</update>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteIccardDeviceId">
|
||||||
|
delete from t_iccard_device where id = #{deviceId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -784,128 +784,50 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
|
|||||||
BigDecimal decimal1= activityPowerPriceTotal.multiply(discountRate).setScale(2,BigDecimal.ROUND_HALF_UP);
|
BigDecimal decimal1= activityPowerPriceTotal.multiply(discountRate).setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||||
BigDecimal decimal2= activityServicePriceTotal.multiply(discountRate).setScale(2,BigDecimal.ROUND_HALF_UP);
|
BigDecimal decimal2= activityServicePriceTotal.multiply(discountRate).setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||||
Integer discountType = activity.getDiscountType();
|
Integer discountType = activity.getDiscountType();
|
||||||
long between = activity.getEndTime().getTime()-endTime.getTime();
|
|
||||||
//说明活动时间大于用户充电结束时间
|
//说明活动时间大于用户充电结束时间
|
||||||
if(between>0){
|
if(discountType.equals(1)){
|
||||||
if(discountType.equals(1)){
|
if(promotionDiscount1.compareTo(decimal1.add(decimal2))<0){
|
||||||
if(promotionDiscount1.compareTo(decimal1.add(decimal2))<0){
|
promotionDiscount1 =decimal1.add(decimal2);
|
||||||
promotionDiscount1 =decimal1.add(decimal2);
|
activityPowerPrice1 = decimal1;
|
||||||
activityPowerPrice1 = decimal1;
|
activityServicePrice1 = decimal2;
|
||||||
|
activityId =activity.getActivityId()+"";
|
||||||
|
}
|
||||||
|
}else if(discountType.equals(2)){
|
||||||
|
//服务费
|
||||||
|
if(activityServicePriceTotal.compareTo(decimal2)<0){
|
||||||
|
if(promotionDiscount1.compareTo(activityServicePriceTotal)<0){
|
||||||
|
promotionDiscount1 =activityServicePriceTotal;
|
||||||
|
activityServicePrice1 = activityServicePriceTotal;
|
||||||
|
activityId =activity.getActivityId()+"";
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(promotionDiscount1.compareTo(decimal2)<0){
|
||||||
|
promotionDiscount1 =decimal2;
|
||||||
activityServicePrice1 = decimal2;
|
activityServicePrice1 = decimal2;
|
||||||
activityId =activity.getActivityId()+"";
|
activityId =activity.getActivityId()+"";
|
||||||
}
|
}
|
||||||
}else if(discountType.equals(2)){
|
|
||||||
//服务费
|
|
||||||
if(activityServicePriceTotal.compareTo(decimal2)<0){
|
|
||||||
if(promotionDiscount1.compareTo(activityServicePriceTotal)<0){
|
|
||||||
promotionDiscount1 =activityServicePriceTotal;
|
|
||||||
activityServicePrice1 = activityServicePriceTotal;
|
|
||||||
activityId =activity.getActivityId()+"";
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
if(promotionDiscount1.compareTo(decimal2)<0){
|
|
||||||
promotionDiscount1 =decimal2;
|
|
||||||
activityServicePrice1 = decimal2;
|
|
||||||
activityId =activity.getActivityId()+"";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
//电量抽成
|
|
||||||
BigDecimal chargingDegree = xhpcChargeOrder.getChargingDegree();
|
|
||||||
//电量的钱
|
|
||||||
BigDecimal bigDecimal = chargingDegree.multiply(discountRate).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
||||||
//当电量的折扣大于服务费时,电量==服务费
|
|
||||||
if(activityServicePriceTotal.compareTo(bigDecimal)<0){
|
|
||||||
if(promotionDiscount1.compareTo(activityServicePriceTotal)<0){
|
|
||||||
promotionDiscount1 =activityServicePriceTotal;
|
|
||||||
activityServicePrice1 = activityServicePriceTotal;
|
|
||||||
activityId =activity.getActivityId()+"";
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
if(promotionDiscount1.compareTo(bigDecimal)<0){
|
|
||||||
promotionDiscount1 =bigDecimal;
|
|
||||||
activityServicePrice1 = bigDecimal;
|
|
||||||
activityId =activity.getActivityId()+"";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
//电量抽成
|
||||||
List<Map<String, Object>> reatTimeList = xhpcHistoryOrderService.getReatTimeList(start, "23:59:59", xhpcChargeOrder.getRateModelId());
|
BigDecimal chargingDegree = xhpcChargeOrder.getChargingDegree();
|
||||||
for (int j = 0; j < reatTimeList.size(); j++) {
|
//电量的钱
|
||||||
BigDecimal powerFee = new BigDecimal(0);
|
BigDecimal bigDecimal = chargingDegree.multiply(discountRate).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||||
BigDecimal serviceFee = new BigDecimal(0);
|
//当电量的折扣大于服务费时,电量==服务费
|
||||||
Map<String, Object> map = reatTimeList.get(i);
|
if(activityServicePriceTotal.compareTo(bigDecimal)<0){
|
||||||
String startTime1 = start;
|
if(promotionDiscount1.compareTo(activityServicePriceTotal)<0){
|
||||||
String endTime1 ="23:59:59";
|
promotionDiscount1 =activityServicePriceTotal;
|
||||||
if (reatTimeList.size() == 1) {
|
activityServicePrice1 = activityServicePriceTotal;
|
||||||
powerFee = new BigDecimal(map.get("powerFee").toString());
|
activityId =activity.getActivityId()+"";
|
||||||
serviceFee = new BigDecimal(map.get("serviceFee").toString());
|
|
||||||
} else if (i == 0) {
|
|
||||||
powerFee = new BigDecimal(map.get("powerFee").toString());
|
|
||||||
serviceFee = new BigDecimal(map.get("serviceFee").toString());
|
|
||||||
if ("00:00:00".equals(endTime1)) {
|
|
||||||
endTime1 = "23:59:59";
|
|
||||||
}
|
|
||||||
} else if (i != reatTimeList.size() - 1) {
|
|
||||||
powerFee = new BigDecimal(map.get("powerFee").toString());
|
|
||||||
serviceFee = new BigDecimal(map.get("serviceFee").toString());
|
|
||||||
startTime1 = map.get("startTime").toString();
|
|
||||||
endTime1 = map.get("endTime").toString();
|
|
||||||
if ("00:00:00".equals(endTime1)) {
|
|
||||||
endTime1 = "23:59:59";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
powerFee = new BigDecimal(map.get("powerFee").toString());
|
|
||||||
serviceFee = new BigDecimal(map.get("serviceFee").toString());
|
|
||||||
startTime1 = map.get("startTime").toString();
|
|
||||||
}
|
}
|
||||||
//这个时段的电量
|
}else{
|
||||||
BigDecimal degree =getRealOrderTime(chargeOrderId, parse2+" "+startTime1, parse2+" "+endTime1);
|
if(promotionDiscount1.compareTo(bigDecimal)<0){
|
||||||
BigDecimal decimal3= activityPowerPrice1.multiply(discountRate).setScale(2,BigDecimal.ROUND_HALF_UP);
|
promotionDiscount1 =bigDecimal;
|
||||||
BigDecimal decimal4= activityServicePrice1.multiply(discountRate).setScale(2,BigDecimal.ROUND_HALF_UP);
|
activityServicePrice1 = bigDecimal;
|
||||||
if(discountType.equals(1)){
|
activityId =activity.getActivityId()+"";
|
||||||
if(promotionDiscount1.compareTo(decimal3.add(decimal4))<0){
|
|
||||||
promotionDiscount1 =decimal3.add(decimal4);
|
|
||||||
activityPowerPrice1 = decimal4;
|
|
||||||
activityServicePrice1 = decimal3;
|
|
||||||
activityId =activity.getActivityId()+"";
|
|
||||||
}
|
|
||||||
}else if(discountType.equals(2)){
|
|
||||||
//服务费
|
|
||||||
if(activityServicePriceTotal.compareTo(decimal4)<0){
|
|
||||||
if(promotionDiscount1.compareTo(activityServicePriceTotal)<0){
|
|
||||||
promotionDiscount1 =activityServicePriceTotal;
|
|
||||||
activityServicePrice1 = activityServicePriceTotal;
|
|
||||||
activityId =activity.getActivityId()+"";
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
if(promotionDiscount1.compareTo(decimal4)<0){
|
|
||||||
promotionDiscount1 =decimal4;
|
|
||||||
activityServicePrice1 = decimal4;
|
|
||||||
activityId =activity.getActivityId()+"";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
//电量的钱
|
|
||||||
BigDecimal bigDecimal = degree.multiply(discountRate).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
||||||
//当电量的折扣大于服务费时,电量==服务费
|
|
||||||
if(activityServicePriceTotal.compareTo(bigDecimal)<0){
|
|
||||||
if(promotionDiscount1.compareTo(activityServicePriceTotal)<0){
|
|
||||||
promotionDiscount1 =activityServicePriceTotal;
|
|
||||||
activityServicePrice1 = activityServicePriceTotal;
|
|
||||||
activityId =activity.getActivityId()+"";
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
if(promotionDiscount1.compareTo(bigDecimal)<0){
|
|
||||||
promotionDiscount1 =bigDecimal;
|
|
||||||
activityServicePrice1 = bigDecimal;
|
|
||||||
activityId =activity.getActivityId()+"";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//得到最大的折扣进行计算
|
//得到最大的折扣进行计算
|
||||||
promotionDiscount = promotionDiscount1;
|
promotionDiscount = promotionDiscount1;
|
||||||
|
|||||||
@ -866,6 +866,9 @@
|
|||||||
co.erro_remark as erroRemark,
|
co.erro_remark as erroRemark,
|
||||||
ho.power_price_total as powerPriceTotal,
|
ho.power_price_total as powerPriceTotal,
|
||||||
ho.service_price_total as servicePriceTotal,
|
ho.service_price_total as servicePriceTotal,
|
||||||
|
ho.activity_power_price_total as activityPowerPriceTotal,
|
||||||
|
ho.activity_service_price_total as activityServicePriceTotal,
|
||||||
|
ho.activity_total_price as activityTotalPrice,
|
||||||
ho.internet_commission as internetCommission,
|
ho.internet_commission as internetCommission,
|
||||||
ho.internet_svc_commission as internetSvcCommission,
|
ho.internet_svc_commission as internetSvcCommission,
|
||||||
ho.internet_degree_commission as internetDegreeCommission,
|
ho.internet_degree_commission as internetDegreeCommission,
|
||||||
|
|||||||
@ -139,6 +139,7 @@ public class XhpcInvoiceController extends BaseController {
|
|||||||
xhpcInvoiceService.failInvoiceToUser(requestData);
|
xhpcInvoiceService.failInvoiceToUser(requestData);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
return AjaxResult.error("开失败发票失败");
|
return AjaxResult.error("开失败发票失败");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -213,7 +213,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
|
|||||||
if (redisService.getCacheObject(redisKey) == null) {
|
if (redisService.getCacheObject(redisKey) == null) {
|
||||||
redisService.setCacheObject(redisKey, 1);
|
redisService.setCacheObject(redisKey, 1);
|
||||||
} else {
|
} else {
|
||||||
Integer noReadCount = redisService.getCacheObject(redisKey);
|
Long noReadCount = redisService.getCacheObject(redisKey);
|
||||||
noReadCount = noReadCount + 1;
|
noReadCount = noReadCount + 1;
|
||||||
redisService.setCacheObject(redisKey, noReadCount);
|
redisService.setCacheObject(redisKey, noReadCount);
|
||||||
}
|
}
|
||||||
@ -424,6 +424,9 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
|
|||||||
return specificInvoicedResponse;
|
return specificInvoicedResponse;
|
||||||
}
|
}
|
||||||
//如果用户已经查看了该发票,却再次调用该接口,那么就直接返回数据。
|
//如果用户已经查看了该发票,却再次调用该接口,那么就直接返回数据。
|
||||||
|
if(xhpcInvoice.getIsRead()==null){
|
||||||
|
return specificInvoicedResponse;
|
||||||
|
}
|
||||||
if (xhpcInvoice.getIsRead().equals(IsReadStatusConst.READED)) {
|
if (xhpcInvoice.getIsRead().equals(IsReadStatusConst.READED)) {
|
||||||
return specificInvoicedResponse;
|
return specificInvoicedResponse;
|
||||||
}
|
}
|
||||||
@ -616,10 +619,12 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
|
|||||||
totalServicePrice += (xhpcHistoryOrder.getServicePriceTotal().doubleValue() - xhpcHistoryOrder.getPromotionDiscount().doubleValue());
|
totalServicePrice += (xhpcHistoryOrder.getServicePriceTotal().doubleValue() - xhpcHistoryOrder.getPromotionDiscount().doubleValue());
|
||||||
totalActPrice += xhpcHistoryOrder.getTotalPrice().doubleValue();
|
totalActPrice += xhpcHistoryOrder.getTotalPrice().doubleValue();
|
||||||
}
|
}
|
||||||
System.out.println("<<<<<<<<<<111<<<<<<<<发票 totalActPrice>>>>>>>>>>111>>>>>>>>"+totalActPrice);
|
|
||||||
BigDecimal bigDecimal = saveInvoiceInfoRequest.getInvoiceMoney().setScale(2, BigDecimal.ROUND_HALF_UP);
|
BigDecimal bigDecimal = saveInvoiceInfoRequest.getInvoiceMoney().setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||||
|
BigDecimal bigDecimal2 = new BigDecimal(totalActPrice).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||||
|
System.out.println("<<<<<<<<<<111<<<<<<<<发票 bigDecimal2>>>>>>>>>>111>>>>>>>>"+bigDecimal2);
|
||||||
System.out.println("<<<<<<<<<<111<<<<<<<<发票 bigDecimal>>>>>>>>>>111>>>>>>>>"+bigDecimal);
|
System.out.println("<<<<<<<<<<111<<<<<<<<发票 bigDecimal>>>>>>>>>>111>>>>>>>>"+bigDecimal);
|
||||||
if (!BigDecimal.valueOf(totalActPrice).equals(bigDecimal)) {
|
if (!bigDecimal2.equals(bigDecimal)) {
|
||||||
throw new Exception("传入的发票金额与实际包含的历史订单总金额参数不匹配");
|
throw new Exception("传入的发票金额与实际包含的历史订单总金额参数不匹配");
|
||||||
}
|
}
|
||||||
xhpcInvoice.setInvoiceOrderEletricTotalMoney(BigDecimal.valueOf(totalPowerPrice));
|
xhpcInvoice.setInvoiceOrderEletricTotalMoney(BigDecimal.valueOf(totalPowerPrice));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user