修改首页统计

This commit is contained in:
yuyang 2022-05-30 11:52:26 +08:00
parent f5089056b4
commit 5dd38e8974
8 changed files with 58 additions and 118 deletions

View File

@ -39,6 +39,7 @@ public interface TIccardDeviceMapper {
*/
void updateCardDeviceStatusIsDel(Integer deviceId);
void deleteIccardDeviceId(Integer deviceId);
/**
* query specified card grant device delete status
*

View File

@ -162,6 +162,8 @@ public class XhpcCardServiceImpl implements IXhpcCardService {
String log = JSONUtil.toJsonStr(deviceLogInfo);
tIccardLog.setLog(log);
tIccardLogMapper.insertSelective(tIccardLog);
tIccardDeviceMapper.deleteIccardDeviceId(deviceId);
return R.ok();
}

View File

@ -29,7 +29,7 @@
ccu.usersTime as usersTime,
ccu.status as status
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
<if test="userName !=null and userName !=''">
and ccu.usersName like concat('%', #{userName}, '%')
@ -122,6 +122,7 @@
<select id="getoperatorList" resultType="map">
select
corp_no as corpNo,
operator_id usersCorp,
name as name
from xhpc_operator where tenant_id=#{tenantId} and del_flag =0
</select>

View File

@ -131,9 +131,14 @@
tenant_id = #{tenantId,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateCardDeviceStatusIsDel">
<delete id="updateCardDeviceStatusIsDel">
update t_iccard_device
set del_flag = 1
where id = #{deviceId}
</update>
</delete>
<delete id="deleteIccardDeviceId">
delete from t_iccard_device where id = #{deviceId}
</delete>
</mapper>

View File

@ -784,9 +784,7 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
BigDecimal decimal1= activityPowerPriceTotal.multiply(discountRate).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal decimal2= activityServicePriceTotal.multiply(discountRate).setScale(2,BigDecimal.ROUND_HALF_UP);
Integer discountType = activity.getDiscountType();
long between = activity.getEndTime().getTime()-endTime.getTime();
//说明活动时间大于用户充电结束时间
if(between>0){
if(discountType.equals(1)){
if(promotionDiscount1.compareTo(decimal1.add(decimal2))<0){
promotionDiscount1 =decimal1.add(decimal2);
@ -829,83 +827,7 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
}
}
}
}else{
List<Map<String, Object>> reatTimeList = xhpcHistoryOrderService.getReatTimeList(start, "23:59:59", xhpcChargeOrder.getRateModelId());
for (int j = 0; j < reatTimeList.size(); j++) {
BigDecimal powerFee = new BigDecimal(0);
BigDecimal serviceFee = new BigDecimal(0);
Map<String, Object> map = reatTimeList.get(i);
String startTime1 = start;
String endTime1 ="23:59:59";
if (reatTimeList.size() == 1) {
powerFee = new BigDecimal(map.get("powerFee").toString());
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();
}
//这个时段的电量
BigDecimal degree =getRealOrderTime(chargeOrderId, parse2+" "+startTime1, parse2+" "+endTime1);
BigDecimal decimal3= activityPowerPrice1.multiply(discountRate).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal decimal4= activityServicePrice1.multiply(discountRate).setScale(2,BigDecimal.ROUND_HALF_UP);
if(discountType.equals(1)){
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;

View File

@ -866,6 +866,9 @@
co.erro_remark as erroRemark,
ho.power_price_total as powerPriceTotal,
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_svc_commission as internetSvcCommission,
ho.internet_degree_commission as internetDegreeCommission,

View File

@ -139,6 +139,7 @@ public class XhpcInvoiceController extends BaseController {
xhpcInvoiceService.failInvoiceToUser(requestData);
return AjaxResult.success();
} catch (Exception e) {
e.printStackTrace();
return AjaxResult.error("开失败发票失败");
}
} else {

View File

@ -213,7 +213,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
if (redisService.getCacheObject(redisKey) == null) {
redisService.setCacheObject(redisKey, 1);
} else {
Integer noReadCount = redisService.getCacheObject(redisKey);
Long noReadCount = redisService.getCacheObject(redisKey);
noReadCount = noReadCount + 1;
redisService.setCacheObject(redisKey, noReadCount);
}
@ -424,6 +424,9 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
return specificInvoicedResponse;
}
//如果用户已经查看了该发票却再次调用该接口那么就直接返回数据
if(xhpcInvoice.getIsRead()==null){
return specificInvoicedResponse;
}
if (xhpcInvoice.getIsRead().equals(IsReadStatusConst.READED)) {
return specificInvoicedResponse;
}
@ -616,10 +619,12 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
totalServicePrice += (xhpcHistoryOrder.getServicePriceTotal().doubleValue() - xhpcHistoryOrder.getPromotionDiscount().doubleValue());
totalActPrice += xhpcHistoryOrder.getTotalPrice().doubleValue();
}
System.out.println("<<<<<<<<<<111<<<<<<<<发票 totalActPrice>>>>>>>>>>111>>>>>>>>"+totalActPrice);
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);
if (!BigDecimal.valueOf(totalActPrice).equals(bigDecimal)) {
if (!bigDecimal2.equals(bigDecimal)) {
throw new Exception("传入的发票金额与实际包含的历史订单总金额参数不匹配");
}
xhpcInvoice.setInvoiceOrderEletricTotalMoney(BigDecimal.valueOf(totalPowerPrice));