mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-23 04:25:21 +08:00
bugfix 推送设备充电状态服务费、电费保留4位小数
This commit is contained in:
@@ -192,18 +192,23 @@ public class ZDLServiceImpl implements ZDLService {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String areaCode = "330000,330200,330213";
|
||||
// 根据逗号分组
|
||||
String[] split = StringUtils.split(areaCode, ",");
|
||||
// 只取最后一部分
|
||||
String subAreaCode = split[split.length - 1];
|
||||
String startTime = "00:00:00"; // 00:00:00 格式
|
||||
// 需要将中间的冒号去掉
|
||||
String replace = StringUtils.replace(startTime, ":", "");
|
||||
System.out.println(replace);
|
||||
|
||||
System.out.println(subAreaCode);
|
||||
|
||||
|
||||
String organizationCode = "91310120MAC13L2Q9P";
|
||||
String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
|
||||
System.out.println(equipmentOwnerId); // MAC13L2Q9
|
||||
// String areaCode = "330000,330200,330213";
|
||||
// // 根据逗号分组
|
||||
// String[] split = StringUtils.split(areaCode, ",");
|
||||
// // 只取最后一部分
|
||||
// String subAreaCode = split[split.length - 1];
|
||||
//
|
||||
// System.out.println(subAreaCode);
|
||||
//
|
||||
//
|
||||
// String organizationCode = "91310120MAC13L2Q9P";
|
||||
// String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
|
||||
// System.out.println(equipmentOwnerId); // MAC13L2Q9
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -384,7 +389,10 @@ public class ZDLServiceImpl implements ZDLService {
|
||||
for (BillingPriceVO billingPriceVO : billingPriceVOList) {
|
||||
// 将时段开始时间、电费、服务费信息进行封装
|
||||
policyInfo = new EquipBusinessPolicyVO.PolicyInfo();
|
||||
policyInfo.setStartTime(billingPriceVO.getStartTime() + ":00");
|
||||
String startTime = billingPriceVO.getStartTime() + ":00"; // 00:00:00 格式
|
||||
// 需要将中间的冒号去掉,改为 000000 格式
|
||||
String replace = StringUtils.replace(startTime, ":", "");
|
||||
policyInfo.setStartTime(replace);
|
||||
policyInfo.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
policyInfo.setServicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user