parent
995fe69606
commit
cc6c8b425d
@ -0,0 +1,89 @@
|
|||||||
|
|
||||||
|
import com.charge.task.TaskApplication;
|
||||||
|
import com.charge.task.service.CompanyCarChargeReportService;
|
||||||
|
import com.charge.task.service.CompanyChargeDailyStatisticsGenerateService;
|
||||||
|
import com.charge.task.service.TaskService;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest(classes = TaskApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||||
|
public class TaskTest2 {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
TaskService taskService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CompanyChargeDailyStatisticsGenerateService companyChargeDailyStatisticsGenerateService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
CompanyCarChargeReportService companyCarChargeReportService;
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test01(){
|
||||||
|
companyCarChargeReportService.insertCompanyCarChargeReport("2022-10-17");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test(){
|
||||||
|
// PileOrderMap pileOrderInfo = pileOrderMapDao.findOne("2020033123472571578");
|
||||||
|
// String timeShare = timeShareComputeStr(pileOrderInfo.getMultiChargeDegree());
|
||||||
|
// String chargeBeginTime = ToolDateTime.dateToDateString(pileOrderInfo.getChargeBeginTime());
|
||||||
|
// String chargeEndTime = ToolDateTime.dateToDateString(pileOrderInfo.getChargeEndTime());
|
||||||
|
//
|
||||||
|
// EquipmentChargeOrderDO orderInfo = new EquipmentChargeOrderDO();
|
||||||
|
// orderInfo.setChargeTimesDegree(timeShare);
|
||||||
|
// orderInfo.setChargeBeginTime(pileOrderInfo.getChargeBeginTime());
|
||||||
|
// orderInfo.setChargeEndTime(pileOrderInfo.getChargeEndTime());
|
||||||
|
// orderInfo.setChargeDuration(pileOrderInfo.getChargeDuration());
|
||||||
|
// orderInfo.setChargeBeginDegree(pileOrderInfo.getChargeBeginDegree());
|
||||||
|
// orderInfo.setChargeEndDegree(pileOrderInfo.getChargeEndDegree());
|
||||||
|
// orderInfo.setChargeDegree(pileOrderInfo.getChargeDegree());
|
||||||
|
// orderInfo.setChargeBeginSoc(Float.valueOf(String.valueOf(pileOrderInfo.getChargeBeginSoc())));
|
||||||
|
// orderInfo.setChargeEndSoc(Float.valueOf(String.valueOf(pileOrderInfo.getChargeEndSoc())));
|
||||||
|
// orderInfo.setChargeCurSoc(Float.valueOf(String.valueOf(pileOrderInfo.getChargeEndSoc())));
|
||||||
|
// orderInfo.setChargeStrategy(pileOrderInfo.getChargeStrategy());
|
||||||
|
// orderInfo.setChargeStrategyParam(pileOrderInfo.getChargeStrategyParam());
|
||||||
|
// orderInfo.setBootMode(pileOrderInfo.getBootMode());
|
||||||
|
// orderInfo.setChargeVin(pileOrderInfo.getChargeVin());
|
||||||
|
// orderInfo.setChargeAh((float)pileOrderInfo.getChargeDegree()*100);
|
||||||
|
// orderInfo.setFinishCode(44);
|
||||||
|
// orderInfo.setFinishType(2);
|
||||||
|
// orderInfo.setFinishMsg("补单结束");
|
||||||
|
// orderInfo.setFinishTime(ToolDateTime.getDate());
|
||||||
|
//
|
||||||
|
// System.out.println(chargeBeginTime);
|
||||||
|
// System.out.println(chargeEndTime);
|
||||||
|
// System.out.println(timeShare);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private String timeShareComputeStr(double[] chargeTimesDegree){
|
||||||
|
StringBuilder chargeTimesDegreeStr = new StringBuilder();
|
||||||
|
Stream.iterate(0, i->i+1).limit(chargeTimesDegree.length).forEach(i->{
|
||||||
|
chargeTimesDegreeStr.append(chargeTimesDegree[i]);
|
||||||
|
if (i < chargeTimesDegree.length - 1) {
|
||||||
|
chargeTimesDegreeStr.append(",");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return chargeTimesDegreeStr.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void companyChargeDailyStatisticsGenerateServiceTest() {
|
||||||
|
for (int i = 20; i < 31; i++) {
|
||||||
|
companyChargeDailyStatisticsGenerateService.generateByDateTransaction("2022-09-" + String.format("%02d", i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue