diff --git a/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityWaybillRegistrationController.java b/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityWaybillRegistrationController.java index 398d907..20fa330 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityWaybillRegistrationController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityWaybillRegistrationController.java @@ -4,6 +4,7 @@ import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.service.comprehensive.TrafficDrivingCommitmentService; +import com.zcloud.service.comprehensive.TrafficDrivingTypeService; import com.zcloud.service.comprehensive.TrafficSecurityWaybillRegistrationService; import com.zcloud.util.DateUtil; import com.zcloud.util.Jurisdiction; @@ -26,6 +27,8 @@ public class AppTrafficSecurityWaybillRegistrationController extends BaseControl private TrafficSecurityWaybillRegistrationService trafficSecurityWaybillRegistrationService; @Autowired private TrafficDrivingCommitmentService trafficDrivingCommitmentService; + @Autowired + private TrafficDrivingTypeService trafficDrivingTypeService; @RequestMapping(value = "/listForSecurityWaybillre") @@ -80,10 +83,23 @@ public class AppTrafficSecurityWaybillRegistrationController extends BaseControl Map map = new HashMap<>(); String errInfo = "success"; PageData pd = this.getPageData(); - pd = trafficSecurityWaybillRegistrationService.findById(pd); // 根据ID读取 List commitmentList = trafficDrivingCommitmentService.getDrivingCommitment(pd); + try { + pd = trafficDrivingTypeService.infoCategory(pd); //根据ID读取 +// if(pd.getString("OPERATOR")) +// pd.put("a", "119.60436762"); +// pd.put("b", "39.94546157"); + errInfo = "success"; + map.put("pd", pd); + map.put("result", errInfo); + map.put("msg", "数据获取成功"); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + map.put("result", errInfo); + map.put("msg", "数据获取失败"); + } map.put("commitmentList", commitmentList); - map.put("pd", pd); map.put("result", errInfo); return map; } diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java index 257cf35..a533990 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java @@ -3,6 +3,8 @@ package com.zcloud.controller.comprehensive; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.service.comprehensive.TrafficDrivingCommitmentService; +import com.zcloud.service.comprehensive.TrafficDrivingTypeService; import com.zcloud.service.comprehensive.TrafficSecurityWaybillRegistrationService; import com.zcloud.util.Const; import com.zcloud.util.DateUtil; @@ -27,6 +29,11 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController @Autowired private TrafficSecurityWaybillRegistrationService trafficSecurityWaybillRegistrationService; + @Autowired + private TrafficDrivingCommitmentService trafficDrivingCommitmentService; + @Autowired + private TrafficDrivingTypeService trafficDrivingTypeService; + @RequestMapping(value = "/listForSecurityWaybillre") @ResponseBody public Object listForSecurityWaybillRegistra(Page page) throws Exception { @@ -66,6 +73,38 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController map.put("result", errInfo); return map; } + /** + * 查看详情 + * @return + * @throws Exception + */ + @RequestMapping(value="/getDetail") + @ResponseBody + public Object goEdit() throws Exception { + Map map = new HashMap<>(); + String errInfo = "success"; + PageData pd = this.getPageData(); + List commitmentList = trafficDrivingCommitmentService.getDrivingCommitment(pd); + try { + pd = trafficDrivingTypeService.infoCategory(pd); //根据ID读取 +// if(pd.getString("OPERATOR")) +// pd.put("a", "119.60436762"); +// pd.put("b", "39.94546157"); + errInfo = "success"; + map.put("pd", pd); + map.put("result", errInfo); + map.put("msg", "数据获取成功"); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + map.put("result", errInfo); + map.put("msg", "数据获取失败"); + } + map.put("commitmentList", commitmentList); + map.put("result", errInfo); + return map; + } + //新增 @RequestMapping(value = "/add") diff --git a/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficDrivingSignMapper.java b/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficDrivingSignMapper.java index 7027d5c..5193d96 100644 --- a/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficDrivingSignMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficDrivingSignMapper.java @@ -26,6 +26,7 @@ public interface TrafficDrivingSignMapper { List listAllType(PageData pd); + /** * 列表 * @param page diff --git a/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficDrivingTypeMapper.java b/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficDrivingTypeMapper.java index 911fe4d..05fdc24 100644 --- a/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficDrivingTypeMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficDrivingTypeMapper.java @@ -40,4 +40,11 @@ public interface TrafficDrivingTypeMapper { * @throws Exception */ PageData findById(PageData pd); + + List findCategory(PageData pd); + + List findListbyDetail(PageData pd); + + List findListbyItem(PageData pd); + } diff --git a/src/main/java/com/zcloud/service/comprehensive/TrafficDrivingTypeService.java b/src/main/java/com/zcloud/service/comprehensive/TrafficDrivingTypeService.java index 3431655..f37a4ea 100644 --- a/src/main/java/com/zcloud/service/comprehensive/TrafficDrivingTypeService.java +++ b/src/main/java/com/zcloud/service/comprehensive/TrafficDrivingTypeService.java @@ -19,6 +19,12 @@ public interface TrafficDrivingTypeService { */ public void edit(PageData pd)throws Exception; + /** + * 获取检查记录详情 + * @param pd + * @throws Exception + */ + public PageData infoCategory(PageData pd) throws Exception; List listForDrivingType(Page page); diff --git a/src/main/java/com/zcloud/service/comprehensive/impl/TrafficDrivingTypeServiceImpl.java b/src/main/java/com/zcloud/service/comprehensive/impl/TrafficDrivingTypeServiceImpl.java index 2969d03..fb6c024 100644 --- a/src/main/java/com/zcloud/service/comprehensive/impl/TrafficDrivingTypeServiceImpl.java +++ b/src/main/java/com/zcloud/service/comprehensive/impl/TrafficDrivingTypeServiceImpl.java @@ -2,18 +2,25 @@ package com.zcloud.service.comprehensive.impl; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.comprehensive.TrafficDrivingSignMapper; import com.zcloud.mapper.datasource.comprehensive.TrafficDrivingTypeMapper; import com.zcloud.service.comprehensive.TrafficDrivingTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; @Service public class TrafficDrivingTypeServiceImpl implements TrafficDrivingTypeService { @Autowired private TrafficDrivingTypeMapper trafficDrivingTypeMapper; + @Autowired + private com.zcloud.mapper.datasource.comprehensive.TrafficSecurityWaybillRegistrationMapper TrafficSecurityWaybillRegistrationMapper; + /**新增 @@ -55,4 +62,40 @@ public class TrafficDrivingTypeServiceImpl implements TrafficDrivingTypeService public PageData findById(PageData pd) { return trafficDrivingTypeMapper.findById(pd); } + @Autowired + private TrafficDrivingSignMapper trafficDrivingSignMapper; + + /** + * 获取检查记录详情 + * @param pd + * @throws Exception + */ + public PageData infoCategory(PageData pd)throws Exception{ + PageData cpd = TrafficSecurityWaybillRegistrationMapper.findById(pd); // 根据ID读取 + List varOList = trafficDrivingTypeMapper.findListbyDetail(pd); + List vList = trafficDrivingTypeMapper.findCategory(pd); + List varItemList = trafficDrivingTypeMapper.findListbyItem(pd); + + List pd1Children = new ArrayList<>(); + List pd2Children = new ArrayList<>(); + for (PageData pd1: vList) { + pd1Children = new ArrayList<>(); + for (PageData pd2:varOList) { + pd2Children = new ArrayList<>(); + if (pd1.getString("CHECKTYPE_ID").equals(pd2.getString("CHECKTYPE_ID"))) { + for (PageData pd3:varItemList) { + if (pd2.getString("DRIVING_SIGN_ID").equals(pd3.getString("DRIVING_SIGN_ID"))) { + pd2Children.add(pd3); + } + } + pd2.put("pd2Children",pd2Children); + pd1Children.add(pd2); + } + } + pd1.put("pd1Children",pd1Children); + } + + cpd.put("varList", vList); + return cpd; + } } diff --git a/src/main/resources/mybatis/datasource/comprehensive/TrafficDrivingTypeMapper.xml b/src/main/resources/mybatis/datasource/comprehensive/TrafficDrivingTypeMapper.xml index 35d3341..401cff3 100644 --- a/src/main/resources/mybatis/datasource/comprehensive/TrafficDrivingTypeMapper.xml +++ b/src/main/resources/mybatis/datasource/comprehensive/TrafficDrivingTypeMapper.xml @@ -133,4 +133,55 @@ where DRIVINGTYPE_ID = #{DRIVINGTYPE_ID} + + + + + + + diff --git a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityWaybillRegistrationMapper.xml b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityWaybillRegistrationMapper.xml index f11297d..ab8ef95 100644 --- a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityWaybillRegistrationMapper.xml +++ b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityWaybillRegistrationMapper.xml @@ -144,14 +144,17 @@ select - + , + s.NAME as USERNAME, + s.PHONE, + t.OPERATTIME as STARTTIME, + p.OPERATTIME as STOPTIME, + c.PLATE_NUMBER, + c.APPROVED_TOTAL_MASS, + c.APPROVED_LOAD_CAPACITY, + c.VIN from f + left join sys_user s on s.USER_ID = f.PRACTITIONER + left join bus_traffic_driving_sign t on t.WAYBILLREGISTRATION_ID = f.WAYBILLREGISTRATION_ID and t.CHECKTYPE_ID = 'status001' + left join bus_traffic_driving_sign p on p.WAYBILLREGISTRATION_ID = f.WAYBILLREGISTRATION_ID and p.CHECKTYPE_ID = 'status003' + left join bus_traffic_mechanical_freighttrailer c on c.FREIGHTTRAILER_ID = f.TRUCKCART where f.WAYBILLREGISTRATION_ID = #{WAYBILLREGISTRATION_ID}