优化运维统计显示,定时异常订单工单输入

This commit is contained in:
yuyang 2022-10-28 17:07:14 +08:00
parent 9987dd587c
commit bc4dd0ca51
8 changed files with 35 additions and 19 deletions

View File

@ -55,6 +55,7 @@
ELSE
"C端用户"
END userType
from xhpc_charge_order co
left join xhpc_internet_user as inu on inu.internet_user_id = co.user_id and co.source =1
left join xhpc_app_user as apu on apu.app_user_id = co.user_id and co.source =0
left join xhpc_community_personnel as cop on cop.community_personnel_id = co.user_id and co.source =2

View File

@ -927,13 +927,18 @@ public class XhpcHistoryOrderController extends BaseController {
public void getInvoiceInfo(){
logger.info("++++++++++++每1分钟扫描一次异常订单自动生成工单++++++++++++++++");
try {
int invoiceInfo = chargeOrderService.getChargeOrderStatus();
if(invoiceInfo>0){
List<Map<String, Object>> invoiceInfo = chargeOrderService.getChargeOrderStatus();
if(invoiceInfo !=null && invoiceInfo.size()>0){
Date date = DateUtil.date();
String format = DateUtil.format(date, "yyyy-MM-dd");
R r = workOrderYuService.workOrderMessage(2, format);
if(r.getCode()==200){
workOrderYuService.addNewOrder("2","有异常订单订单待处理","定时任务自动扫描申请异常订单","","","","");
for (int i = 0; i <invoiceInfo.size() ; i++) {
Map<String, Object> map = invoiceInfo.get(i);
String stationId = map.get("chargingStationId").toString();
String serialNumber = map.get("serialNumber").toString().substring(0,16);
workOrderYuService.addNewOrder("2","有异常订单订单待处理","定时任务自动扫描申请异常订单","",stationId,"",serialNumber);
}
}
}
}catch (Exception e){
@ -1132,4 +1137,14 @@ public class XhpcHistoryOrderController extends BaseController {
}
}
}
public static void main(String[] args) {
String tr ="80836000050002012210280905315435";
String substring = tr.substring(0, 16);
System.out.println("substring:"+substring);
}
}

View File

@ -212,7 +212,7 @@ public interface XhpcChargeOrderMapper {
*/
List<XhpcChargeOrder> getFourTimsStatus();
int getChargeOrderStatus();
List<Map<String, Object>> getChargeOrderStatus();
/**
* 查询相同桩之后是否有订单结算
* @param serialNumber 订单号

View File

@ -164,7 +164,7 @@ public interface IXhpcChargeOrderService {
* 查询是否有异常订单
* @return
*/
int getChargeOrderStatus();
List<Map<String, Object>> getChargeOrderStatus();
//获取桩信息
Map<String,Object> getXhpcChargingPileById(Long chargingPileId);

View File

@ -723,7 +723,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
* @return
*/
@Override
public int getChargeOrderStatus() {
public List<Map<String, Object>> getChargeOrderStatus() {
return xhpcChargeOrderMapper.getChargeOrderStatus();
}

View File

@ -1823,28 +1823,28 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
mapStatus.put("number",0);
Map<String, Object> mapStatus1 = new HashMap<>();
mapStatus1.put("type",12);
mapStatus1.put("name","版本号问题");
mapStatus1.put("type",13);
mapStatus1.put("name","校时校价问题");
mapStatus1.put("number",0);
Map<String, Object> mapStatus2 = new HashMap<>();
mapStatus2.put("type",12);
mapStatus2.put("name","版本号问题");
mapStatus2.put("type",14);
mapStatus2.put("name","费率问题");
mapStatus2.put("number",0);
Map<String, Object> mapStatus3 = new HashMap<>();
mapStatus3.put("type",12);
mapStatus3.put("name","版本号问题");
mapStatus3.put("type",15);
mapStatus3.put("name","离线问题");
mapStatus3.put("number",0);
Map<String, Object> mapStatus4 = new HashMap<>();
mapStatus4.put("type",12);
mapStatus4.put("name","版本号问题");
mapStatus4.put("type",16);
mapStatus4.put("name","故障问题");
mapStatus4.put("number",0);
Map<String, Object> mapStatus5 = new HashMap<>();
mapStatus5.put("type",12);
mapStatus5.put("name","版本号问题");
mapStatus5.put("type",17);
mapStatus5.put("name","未知问题");
mapStatus5.put("number",0);
map.add(mapStatus);

View File

@ -719,8 +719,8 @@
select * from xhpc_charge_order where now() >DATE_ADD(create_time,interval 4 hour) and status=0
</select>
<select id="getChargeOrderStatus" resultType="int">
select count(charge_order_id) from xhpc_charge_order where status =2
<select id="getChargeOrderStatus" resultType="map">
select charging_station_id chargingStationId,serial_number serialNumber from xhpc_charge_order where status =2
</select>
<select id="getSerialNumberLike" resultType="int">
select count(charge_order_id) from xhpc_charge_order where serial_number like concat('%', #{serialNumber}, '%') and charge_order_id &gt; #{chargeOrderId} and status=1

View File

@ -1688,7 +1688,7 @@
and find_in_set (xwo.station_id,(select station_ids from xhpc_work_user where work_user_id=#{logOperatorId}))
</if>
<if test="tenantId !=null and '' !=tenantId">
and xwo.tenant_id=#{tenantId}
and xwtd.tenant_id=#{tenantId}
</if>
GROUP BY xwtd.work_type_id
</select>