mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 03:55:17 +08:00
Merge branch 'dev-zza' into dev
This commit is contained in:
@@ -0,0 +1,173 @@
|
||||
package com.jsowell.pile.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.jsowell.common.annotation.Excel;
|
||||
import com.jsowell.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 电池充电算法记录对象 charge_algorithm_record
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2025-04-12
|
||||
*/
|
||||
@Data
|
||||
public class ChargeAlgorithmRecord extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@Excel(name = "订单编号")
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 总体得分
|
||||
*/
|
||||
@Excel(name = "总体得分")
|
||||
private String score;
|
||||
|
||||
/**
|
||||
* 健康指标-soh
|
||||
*/
|
||||
@Excel(name = "健康指标-soh")
|
||||
private BigDecimal capacityMetrics;
|
||||
|
||||
/**
|
||||
* 健康指标-soe
|
||||
*/
|
||||
@Excel(name = "健康指标-soe")
|
||||
private BigDecimal energyIndicator;
|
||||
|
||||
/**
|
||||
* 健康指标-一致性
|
||||
*/
|
||||
@Excel(name = "健康指标-一致性")
|
||||
private String consistency;
|
||||
|
||||
/**
|
||||
* 温度一致性
|
||||
*/
|
||||
@Excel(name = "温度一致性")
|
||||
private String tempConsistency;
|
||||
|
||||
/**
|
||||
* 电压一致性
|
||||
*/
|
||||
@Excel(name = "电压一致性")
|
||||
private String voltConsistency;
|
||||
|
||||
/**
|
||||
* 容量一致性
|
||||
*/
|
||||
@Excel(name = "容量一致性")
|
||||
private String capacityConsistency;
|
||||
|
||||
/**
|
||||
* 健康指标-sot
|
||||
*/
|
||||
@Excel(name = "健康指标-sot")
|
||||
private BigDecimal sot;
|
||||
|
||||
/**
|
||||
* 安全指标-热失控
|
||||
*/
|
||||
@Excel(name = "安全指标-热失控")
|
||||
private String thermalRunaway;
|
||||
|
||||
/**
|
||||
* 安全指标-冷却系统
|
||||
*/
|
||||
@Excel(name = "安全指标-冷却系统")
|
||||
private String cooling;
|
||||
|
||||
/**
|
||||
* 安全指标-气密性
|
||||
*/
|
||||
@Excel(name = "安全指标-气密性")
|
||||
private String seal;
|
||||
|
||||
/**
|
||||
* 充电后 soc 值
|
||||
*/
|
||||
@Excel(name = "充电后 soc 值")
|
||||
private String currentSoc;
|
||||
|
||||
/**
|
||||
* 故障指标-Soc 跳变异常(value:结果值result:结果为0正常,其他异常 threshold:异常阈值)
|
||||
*/
|
||||
@Excel(name = "故障指标-Soc 跳变异常", readConverterExp = "v=alue:结果值result:结果为0正常,其他异常,t=hreshold:异常阈值")
|
||||
private String socAlarm;
|
||||
|
||||
/**
|
||||
* 故障指标-温差异常
|
||||
*/
|
||||
@Excel(name = "故障指标-温差异常")
|
||||
private String tempDiffAlarm;
|
||||
|
||||
/**
|
||||
* 故障指标-温升异常(value:结果值result:结果为0正常,其他异常 threshold:异常阈值)
|
||||
*/
|
||||
@Excel(name = "故障指标-温升异常", readConverterExp = "v=alue:结果值result:结果为0正常,其他异常,t=hreshold:异常阈值")
|
||||
private String tempRiseAlarm;
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String maxAllowableVoltageAlarm;
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String maxAllowableElectricityAlarm;
|
||||
|
||||
/**
|
||||
* 安全体系指标
|
||||
*/
|
||||
@Excel(name = "安全体系指标")
|
||||
private String securitySystemLevel;
|
||||
|
||||
/**
|
||||
* 故障体系指标
|
||||
*/
|
||||
@Excel(name = "故障体系指标")
|
||||
private String failureMetrics;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderCode", getOrderCode())
|
||||
.append("score", getScore())
|
||||
.append("capacityMetrics", getCapacityMetrics())
|
||||
.append("energyIndicator", getEnergyIndicator())
|
||||
.append("consistency", getConsistency())
|
||||
.append("tempConsistency", getTempConsistency())
|
||||
.append("voltConsistency", getVoltConsistency())
|
||||
.append("capacityConsistency", getCapacityConsistency())
|
||||
.append("sot", getSot())
|
||||
.append("thermalRunaway", getThermalRunaway())
|
||||
.append("cooling", getCooling())
|
||||
.append("seal", getSeal())
|
||||
.append("currentSoc", getCurrentSoc())
|
||||
.append("socAlarm", getSocAlarm())
|
||||
.append("tempDiffAlarm", getTempDiffAlarm())
|
||||
.append("tempRiseAlarm", getTempRiseAlarm())
|
||||
.append("maxAllowableVoltageAlarm", getMaxAllowableVoltageAlarm())
|
||||
.append("maxAllowableElectricityAlarm", getMaxAllowableElectricityAlarm())
|
||||
.append("securitySystemLevel", getSecuritySystemLevel())
|
||||
.append("failureMetrics", getFailureMetrics())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.jsowell.pile.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.pile.domain.ChargeAlgorithmRecord;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 电池充电算法记录Mapper接口
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2025-04-12
|
||||
*/
|
||||
@Repository
|
||||
public interface ChargeAlgorithmRecordMapper {
|
||||
/**
|
||||
* 查询电池充电算法记录
|
||||
*
|
||||
* @param id 电池充电算法记录主键
|
||||
* @return 电池充电算法记录
|
||||
*/
|
||||
public ChargeAlgorithmRecord selectChargeAlgorithmRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 查询电池充电算法记录列表
|
||||
*
|
||||
* @param chargeAlgorithmRecord 电池充电算法记录
|
||||
* @return 电池充电算法记录集合
|
||||
*/
|
||||
public List<ChargeAlgorithmRecord> selectChargeAlgorithmRecordList(ChargeAlgorithmRecord chargeAlgorithmRecord);
|
||||
|
||||
/**
|
||||
* 新增电池充电算法记录
|
||||
*
|
||||
* @param chargeAlgorithmRecord 电池充电算法记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertChargeAlgorithmRecord(ChargeAlgorithmRecord chargeAlgorithmRecord);
|
||||
|
||||
/**
|
||||
* 修改电池充电算法记录
|
||||
*
|
||||
* @param chargeAlgorithmRecord 电池充电算法记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateChargeAlgorithmRecord(ChargeAlgorithmRecord chargeAlgorithmRecord);
|
||||
|
||||
/**
|
||||
* 删除电池充电算法记录
|
||||
*
|
||||
* @param id 电池充电算法记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteChargeAlgorithmRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除电池充电算法记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteChargeAlgorithmRecordByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 通过订单号查询充电电池算法报告
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
ChargeAlgorithmRecord queryRecordByOrderCode(String orderCode);
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.pile.domain.ChargeAlgorithmRecord;
|
||||
|
||||
/**
|
||||
* 电池充电算法记录Service接口
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2025-04-12
|
||||
*/
|
||||
public interface ChargeAlgorithmRecordService {
|
||||
/**
|
||||
* 查询电池充电算法记录
|
||||
*
|
||||
* @param id 电池充电算法记录主键
|
||||
* @return 电池充电算法记录
|
||||
*/
|
||||
public ChargeAlgorithmRecord selectChargeAlgorithmRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 查询电池充电算法记录列表
|
||||
*
|
||||
* @param chargeAlgorithmRecord 电池充电算法记录
|
||||
* @return 电池充电算法记录集合
|
||||
*/
|
||||
public List<ChargeAlgorithmRecord> selectChargeAlgorithmRecordList(ChargeAlgorithmRecord chargeAlgorithmRecord);
|
||||
|
||||
/**
|
||||
* 新增电池充电算法记录
|
||||
*
|
||||
* @param chargeAlgorithmRecord 电池充电算法记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertChargeAlgorithmRecord(ChargeAlgorithmRecord chargeAlgorithmRecord);
|
||||
|
||||
/**
|
||||
* 修改电池充电算法记录
|
||||
*
|
||||
* @param chargeAlgorithmRecord 电池充电算法记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateChargeAlgorithmRecord(ChargeAlgorithmRecord chargeAlgorithmRecord);
|
||||
|
||||
/**
|
||||
* 批量删除电池充电算法记录
|
||||
*
|
||||
* @param ids 需要删除的电池充电算法记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteChargeAlgorithmRecordByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除电池充电算法记录信息
|
||||
*
|
||||
* @param id 电池充电算法记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteChargeAlgorithmRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 通过订单号查询充电电池算法报告
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
ChargeAlgorithmRecord queryRecordByOrderCode(String orderCode);
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.pile.service.ChargeAlgorithmRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jsowell.pile.mapper.ChargeAlgorithmRecordMapper;
|
||||
import com.jsowell.pile.domain.ChargeAlgorithmRecord;
|
||||
|
||||
/**
|
||||
* 电池充电算法记录Service业务层处理
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2025-04-12
|
||||
*/
|
||||
@Service
|
||||
public class ChargeAlgorithmRecordServiceImpl implements ChargeAlgorithmRecordService {
|
||||
@Autowired
|
||||
private ChargeAlgorithmRecordMapper chargeAlgorithmRecordMapper;
|
||||
|
||||
/**
|
||||
* 查询电池充电算法记录
|
||||
*
|
||||
* @param id 电池充电算法记录主键
|
||||
* @return 电池充电算法记录
|
||||
*/
|
||||
@Override
|
||||
public ChargeAlgorithmRecord selectChargeAlgorithmRecordById(Long id) {
|
||||
return chargeAlgorithmRecordMapper.selectChargeAlgorithmRecordById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询电池充电算法记录列表
|
||||
*
|
||||
* @param chargeAlgorithmRecord 电池充电算法记录
|
||||
* @return 电池充电算法记录
|
||||
*/
|
||||
@Override
|
||||
public List<ChargeAlgorithmRecord> selectChargeAlgorithmRecordList(ChargeAlgorithmRecord chargeAlgorithmRecord) {
|
||||
return chargeAlgorithmRecordMapper.selectChargeAlgorithmRecordList(chargeAlgorithmRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电池充电算法记录
|
||||
*
|
||||
* @param chargeAlgorithmRecord 电池充电算法记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertChargeAlgorithmRecord(ChargeAlgorithmRecord chargeAlgorithmRecord) {
|
||||
chargeAlgorithmRecord.setCreateTime(DateUtils.getNowDate());
|
||||
return chargeAlgorithmRecordMapper.insertChargeAlgorithmRecord(chargeAlgorithmRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电池充电算法记录
|
||||
*
|
||||
* @param chargeAlgorithmRecord 电池充电算法记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateChargeAlgorithmRecord(ChargeAlgorithmRecord chargeAlgorithmRecord) {
|
||||
return chargeAlgorithmRecordMapper.updateChargeAlgorithmRecord(chargeAlgorithmRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除电池充电算法记录
|
||||
*
|
||||
* @param ids 需要删除的电池充电算法记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteChargeAlgorithmRecordByIds(Long[] ids) {
|
||||
return chargeAlgorithmRecordMapper.deleteChargeAlgorithmRecordByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除电池充电算法记录信息
|
||||
*
|
||||
* @param id 电池充电算法记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteChargeAlgorithmRecordById(Long id) {
|
||||
return chargeAlgorithmRecordMapper.deleteChargeAlgorithmRecordById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过订单号查询充电电池算法报告
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ChargeAlgorithmRecord queryRecordByOrderCode(String orderCode) {
|
||||
return chargeAlgorithmRecordMapper.queryRecordByOrderCode(orderCode);
|
||||
}
|
||||
}
|
||||
@@ -8,18 +8,22 @@ import com.jsowell.adapay.dto.PaymentConfirmParam;
|
||||
import com.jsowell.adapay.dto.SplitData;
|
||||
import com.jsowell.adapay.response.PaymentConfirmResponse;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.core.domain.model.LoginUser;
|
||||
import com.jsowell.common.core.page.PageResponse;
|
||||
import com.jsowell.common.enums.DelFlagEnum;
|
||||
import com.jsowell.common.enums.adapay.AdapayStatusEnum;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.SecurityUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.AdapayMemberAccount;
|
||||
import com.jsowell.pile.domain.OrderSplitRecord;
|
||||
import com.jsowell.pile.domain.PileMerchantInfo;
|
||||
import com.jsowell.pile.dto.QueryOrderSplitDTO;
|
||||
import com.jsowell.pile.dto.SplitOrderDTO;
|
||||
import com.jsowell.pile.mapper.OrderSplitRecordMapper;
|
||||
import com.jsowell.pile.service.AdapayMemberAccountService;
|
||||
import com.jsowell.pile.service.OrderSplitRecordService;
|
||||
import com.jsowell.pile.service.PileMerchantInfoService;
|
||||
import com.jsowell.pile.vo.OrderInfoDetailVO;
|
||||
import com.jsowell.pile.vo.web.*;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -28,10 +32,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@@ -40,6 +41,9 @@ public class OrderSplitRecordServiceImpl implements OrderSplitRecordService {
|
||||
@Resource
|
||||
private OrderSplitRecordMapper orderSplitRecordMapper;
|
||||
|
||||
@Autowired
|
||||
private PileMerchantInfoService pileMerchantInfoService;
|
||||
|
||||
@Autowired
|
||||
private AdapayMemberAccountService adapayMemberAccountService;
|
||||
|
||||
@@ -264,6 +268,10 @@ public class OrderSplitRecordServiceImpl implements OrderSplitRecordService {
|
||||
@Override
|
||||
public PageResponse queryOrderSplitData(QueryOrderSplitDTO dto) {
|
||||
List<SplitRecordInfoVO> resultList = new ArrayList<>();
|
||||
// 获取当前登录用户信息
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
// 通过 depId 查询运营商记录表,如果查出来,则为运营商
|
||||
PileMerchantInfo pileMerchantInfo = pileMerchantInfoService.queryInfoByDeptId(String.valueOf(loginUser.getDeptId()));
|
||||
|
||||
// 设置分页参数
|
||||
int pageNo = dto.getPageNo() == null ? 1 : dto.getPageNo();
|
||||
@@ -274,6 +282,7 @@ public class OrderSplitRecordServiceImpl implements OrderSplitRecordService {
|
||||
List<String> orderCodes = orderSplitRecordMapper.queryOrderCodesByParams(dto);
|
||||
PageInfo<String> pageInfo = new PageInfo<>(orderCodes);
|
||||
|
||||
// 查询符合条件的分账记录
|
||||
List<OrderSplitRecordVO> orderSplitRecordVOS = orderSplitRecordMapper.queryOrderSplitData(pageInfo.getList());
|
||||
|
||||
// 根据 orderCode 分组
|
||||
@@ -307,10 +316,21 @@ public class OrderSplitRecordServiceImpl implements OrderSplitRecordService {
|
||||
.build();
|
||||
orderSplitList.add(orderSplit);
|
||||
}
|
||||
// 对 orderSplitList 进行排序,将当前登录用户的分账记录放在第一条
|
||||
if (pileMerchantInfo != null) {
|
||||
for (int i = 0; i < orderSplitList.size(); i++) {
|
||||
SplitRecordInfoVO.OrderSplit orderSplit = orderSplitList.get(i);
|
||||
if (StringUtils.equals(String.valueOf(pileMerchantInfo.getId()), orderSplit.getMerchantId())) {
|
||||
// 实则是调用swap()方法,将符合条件的记录与第一条记录进行位置互换
|
||||
Collections.swap(orderSplitList, i, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
vo.setOrderSplitList(orderSplitList);
|
||||
|
||||
resultList.add(vo);
|
||||
}
|
||||
|
||||
// 组装分页返回参数
|
||||
PageResponse pageResponse = PageResponse.builder()
|
||||
.pageSize(pageSize)
|
||||
|
||||
Reference in New Issue
Block a user