Commit 8082a828 authored by zhuangzhuang's avatar zhuangzhuang

4.16-修改首页数据的bug(延误数量)

parent 3c6b25d7
...@@ -33,7 +33,7 @@ public interface CircuitMapper { ...@@ -33,7 +33,7 @@ public interface CircuitMapper {
Integer getCount(@Param("time") String time,@Param("companyName") String companyName); Integer getCount(@Param("time") String time,@Param("companyName") String companyName);
List<ResultCircuitVo> getByContainerNo(@Param("cargoNo") String cargoNo,@Param("companyName") String companyName); List<ResultCircuitVo> getByPlateNo(@Param("plateNo") String plateNo,@Param("companyName") String companyName);
ResultCircuitForAppVo getByTransportationNoForApp(@Param("transportationNo") String transportationNo,@Param("companyName") String companyName); ResultCircuitForAppVo getByTransportationNoForApp(@Param("transportationNo") String transportationNo,@Param("companyName") String companyName);
......
...@@ -67,8 +67,8 @@ public class CircuitService { ...@@ -67,8 +67,8 @@ public class CircuitService {
return circuitMapper.getCount(time,companyName); return circuitMapper.getCount(time,companyName);
} }
public List<ResultCircuitVo> getByContainerNo(String cargoNo,String companyName){ public List<ResultCircuitVo> getByPlateNo(String plateNo,String companyName){
return circuitMapper.getByContainerNo(cargoNo,companyName); return circuitMapper.getByPlateNo(plateNo,companyName);
} }
public List<ResultCircuitVo> getByCircuitState(Integer circuitState,String companyName){ public List<ResultCircuitVo> getByCircuitState(Integer circuitState,String companyName){
......
...@@ -847,14 +847,14 @@ public class CircuitController { ...@@ -847,14 +847,14 @@ public class CircuitController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"), @ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
}) })
@RequestMapping(value="/getByContainerNo",method = RequestMethod.POST) @RequestMapping(value="/getByPlateNo",method = RequestMethod.POST)
public Object getByContainerNo(@RequestBody String cargoNo,HttpServletRequest request){ public Object getByPlateNo(@RequestBody String plateNo,HttpServletRequest request){
String token = request.getHeader("Account_token"); String token = request.getHeader("Account_token");
String datum = tokenRedisService.get("TOKEN_" +token); String datum = tokenRedisService.get("TOKEN_" +token);
UserRedisVo user = gson.fromJson(datum,UserRedisVo.class); UserRedisVo user = gson.fromJson(datum,UserRedisVo.class);
JSONObject jsonObject= JSON.parseObject(cargoNo); JSONObject jsonObject= JSON.parseObject(plateNo);
cargoNo=(String)jsonObject.get("cargoNo"); plateNo=(String)jsonObject.get("plateNo");
return circuitService.getByContainerNo(cargoNo,user.getCompanyName()); return circuitService.getByPlateNo(plateNo,user.getCompanyName());
} }
//评价 //评价
......
...@@ -96,7 +96,6 @@ public class HomePageController { ...@@ -96,7 +96,6 @@ public class HomePageController {
//获取所有的线路数量 //获取所有的线路数量
dataVo.setSum(circuitService.getCount(time,user.getCompanyName()));//总数量 dataVo.setSum(circuitService.getCount(time,user.getCompanyName()));//总数量
//获取近几天的线路信息 //获取近几天的线路信息
dataVo.setOnRoute(circuitService.getOnRoute(time,user.getCompanyName()));//在途数量 dataVo.setOnRoute(circuitService.getOnRoute(time,user.getCompanyName()));//在途数量
dataVo.setDelay(circuitService.getDelayCount(System.currentTimeMillis(),time,user.getCompanyName()));//延误数量 dataVo.setDelay(circuitService.getDelayCount(System.currentTimeMillis(),time,user.getCompanyName()));//延误数量
dataVo.setAlarmed( alarmLogServcie.getCount(time));//报警数量 dataVo.setAlarmed( alarmLogServcie.getCount(time));//报警数量
......
...@@ -373,7 +373,10 @@ public class UserController { ...@@ -373,7 +373,10 @@ public class UserController {
} }
//获取当前的用户名 //获取当前的用户名
@ApiOperation(value = "获取当前的用户名",notes = "获取当前的用户名") @ApiOperation(value = "获取当前用户的信息",notes = "获取用户的信息" +
"userName:用户名" +
"time:时间" +
"ipAddres:ip")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"), @ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
}) })
......
...@@ -196,10 +196,10 @@ ...@@ -196,10 +196,10 @@
<!--延误数量--> <!--延误数量-->
<select id="getDelayCount" resultType="java.lang.Integer" > <select id="getDelayCount" resultType="java.lang.Integer" >
select count(id) from circuit where state =1 select GROUP_CONCAT(id),count(id) from circuit where state =1
and endtime &lt; compTime or compTime &lt; #{compTime,jdbcType=BIGINT} AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(createTime/1000,'%Y-%m-%d %H:%i:%s'))
and DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(createTime/1000,'%Y-%m-%d %H:%i:%s')) AND company_id=(SELECT id from company where companyName="上海辉度")
AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR}) AND endtime > compTime or compTime &lt; #{compTime,jdbcType=BIGINT}
</select> </select>
<!--总数量--> <!--总数量-->
...@@ -211,12 +211,12 @@ ...@@ -211,12 +211,12 @@
</select> </select>
<!--根据车牌号查线路--> <!--根据车牌号查线路-->
<select id="getByContainerNo" parameterType="String" resultType="com.example.tdl.domain.vo.ResultCircuitVo"> <select id="getByPlateNo" parameterType="String" resultType="com.example.tdl.domain.vo.ResultCircuitVo">
SELECT c.transportationNo,cargoNo,(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id ORDER BY sequence LIMIT 1)) startCity,startTime, SELECT c.transportationNo,cargoNo,(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id ORDER BY sequence LIMIT 1)) startCity,startTime,
(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id ORDER BY sequence DESC LIMIT 1)) endCity,endTime,circuitState, (SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id ORDER BY sequence DESC LIMIT 1)) endCity,endTime,circuitState,
(SELECT alarmType FROM alarm WHERE id IN (SELECT alarm_id from tdl_gateway_log WHERE transportationNo=c.transportationNo)) alarmType, (SELECT alarmType FROM alarm WHERE id IN (SELECT alarm_id from tdl_gateway_log WHERE transportationNo=c.transportationNo)) alarmType,
(select GROUP_CONCAT(DISTINCT classify) from alarm_log al where al.transportationNo = c.transportationNo) alarm,evaluate,transportation (select GROUP_CONCAT(DISTINCT classify) from alarm_log al where al.transportationNo = c.transportationNo) alarm,evaluate,transportation
from circuit c where c.state=1 AND cargoNo=#{cargoNo,jdbcType=VARCHAR} from circuit c where c.state=1 AND plateNo=#{plateNo,jdbcType=VARCHAR}
AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR}) AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment