Commit 8082a828 authored by zhuangzhuang's avatar zhuangzhuang

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

parent 3c6b25d7
......@@ -33,7 +33,7 @@ public interface CircuitMapper {
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);
......
......@@ -67,8 +67,8 @@ public class CircuitService {
return circuitMapper.getCount(time,companyName);
}
public List<ResultCircuitVo> getByContainerNo(String cargoNo,String companyName){
return circuitMapper.getByContainerNo(cargoNo,companyName);
public List<ResultCircuitVo> getByPlateNo(String plateNo,String companyName){
return circuitMapper.getByPlateNo(plateNo,companyName);
}
public List<ResultCircuitVo> getByCircuitState(Integer circuitState,String companyName){
......
......@@ -847,14 +847,14 @@ public class CircuitController {
@ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
})
@RequestMapping(value="/getByContainerNo",method = RequestMethod.POST)
public Object getByContainerNo(@RequestBody String cargoNo,HttpServletRequest request){
@RequestMapping(value="/getByPlateNo",method = RequestMethod.POST)
public Object getByPlateNo(@RequestBody String plateNo,HttpServletRequest request){
String token = request.getHeader("Account_token");
String datum = tokenRedisService.get("TOKEN_" +token);
UserRedisVo user = gson.fromJson(datum,UserRedisVo.class);
JSONObject jsonObject= JSON.parseObject(cargoNo);
cargoNo=(String)jsonObject.get("cargoNo");
return circuitService.getByContainerNo(cargoNo,user.getCompanyName());
JSONObject jsonObject= JSON.parseObject(plateNo);
plateNo=(String)jsonObject.get("plateNo");
return circuitService.getByPlateNo(plateNo,user.getCompanyName());
}
//评价
......
......@@ -96,7 +96,6 @@ public class HomePageController {
//获取所有的线路数量
dataVo.setSum(circuitService.getCount(time,user.getCompanyName()));//总数量
//获取近几天的线路信息
dataVo.setOnRoute(circuitService.getOnRoute(time,user.getCompanyName()));//在途数量
dataVo.setDelay(circuitService.getDelayCount(System.currentTimeMillis(),time,user.getCompanyName()));//延误数量
dataVo.setAlarmed( alarmLogServcie.getCount(time));//报警数量
......
......@@ -373,7 +373,10 @@ public class UserController {
}
//获取当前的用户名
@ApiOperation(value = "获取当前的用户名",notes = "获取当前的用户名")
@ApiOperation(value = "获取当前用户的信息",notes = "获取用户的信息" +
"userName:用户名" +
"time:时间" +
"ipAddres:ip")
@ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
})
......
......@@ -196,10 +196,10 @@
<!--延误数量-->
<select id="getDelayCount" resultType="java.lang.Integer" >
select 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 company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
select GROUP_CONCAT(id),count(id) from circuit where state =1
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 endtime > compTime or compTime &lt; #{compTime,jdbcType=BIGINT}
</select>
<!--总数量-->
......@@ -211,12 +211,12 @@
</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 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 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})
</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