| | |
| | | import com.ruoyi.cwgl.domain.dto.TakeReviewDto; |
| | | import com.ruoyi.cwgl.service.IKeyCollectionInfoService; |
| | | import com.ruoyi.cwgl.service.IRequestLogService; |
| | | import com.ruoyi.tms.domain.TmsCarKeyDispatch; |
| | | import com.ruoyi.tms.service.ITmsCarKeyDispatchService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private IKeyCollectionInfoService keyCollectionInfoService; |
| | | @Autowired |
| | | private IRequestLogService logService; |
| | | @Autowired |
| | | private ITmsCarKeyDispatchService tmsCarKeyDispatchService; |
| | | |
| | | /** |
| | | * 上报取出审核 |
| | |
| | | return success; |
| | | } |
| | | |
| | | KeyCollectionInfo keyCollectionInfo = keyCollectionInfoService.selectCwData(takeReviewDto); |
| | | TmsCarKeyDispatch tmsCarKeyDispatch = tmsCarKeyDispatchService.selectTmsCarKeyDispatchdriverMobile(takeReviewDto.getDriverCode()); |
| | | //添加请求日志 |
| | | RequestLog requestLog = new RequestLog(); |
| | | requestLog.setDriverCode(takeReviewDto.getDriverCode()); |
| | | requestLog.setDriverName(takeReviewDto.getDriverName()); |
| | | requestLog.setReqTime(takeReviewDto.getHandleTime()); |
| | | if (keyCollectionInfo!=null){ |
| | | String boxNum = keyCollectionInfo.getBoxNum(); |
| | | if (tmsCarKeyDispatch!=null){ |
| | | String boxNum = tmsCarKeyDispatch.getVehicleCarKeyNo(); |
| | | requestLog.setBoxNum(boxNum); |
| | | |
| | | |
| | |
| | | requestLog.setType(0); |
| | | logService.insertRequestLog(requestLog); |
| | | |
| | | AjaxResult ajaxResult = keyCollectionInfoService.takeReview(keyCollectionInfo); |
| | | AjaxResult ajaxResult = tmsCarKeyDispatchService.takeReview(tmsCarKeyDispatch); |
| | | if (!ajaxResult.get("code").equals(0)){ |
| | | ajaxResult = keyCollectionInfoService.selectSmartLockerApplication(takeReviewDto); |
| | | |
| | | }else { |
| | | if (keyCollectionInfo != null) { |
| | | String boxNum = (String) ajaxResult.get("boxNumber"); |
| | | if (StringUtils.isEmpty(boxNum) || (Integer.parseInt(boxNum) < 1 && Integer.parseInt(boxNum) > 60)) { |
| | | boxNum = keyCollectionInfoService.selectCwBoxNum(keyCollectionInfo.getLicensePlateNumber()); |
| | | ajaxResult.put("boxNumber",boxNum); |
| | | } |
| | | |
| | | } |
| | | } |
| | | return ajaxResult; |
| | | |
| | |
| | | AjaxResult selectSmartLockerApplication(TakeReviewDto takeReviewDto); |
| | | |
| | | String selectCwBoxNum(String licensePlateNumber); |
| | | |
| | | String selectBoxNum(String licensePlateNumber); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询钥匙领取信息 |
| | | * |
| | |
| | | public String selectCwBoxNum(String licensePlateNumber) { |
| | | return keyCollectionInfoMapper.selectCwBoxNum(licensePlateNumber); |
| | | } |
| | | |
| | | @Override |
| | | public String selectBoxNum(String licensePlateNumber) { |
| | | return null; |
| | | } |
| | | } |
| | |
| | | |
| | | private String shelfCode; |
| | | |
| | | private String receiverAddress; |
| | | |
| | | private String shipperAddress; |
| | | |
| | | |
| | | // 0 = '行程中',1= '待甩挂' 2 = '待接挂',3 = '已甩挂',4 = '已接挂'5 = '完成行程' |
| | | private Integer tddStatus; |
| | | // 要求最晚发车时间 |
| | |
| | | * @return 结果 |
| | | */ |
| | | public int deleteTmsCarKeyDispatchByIds(Integer[] ids); |
| | | |
| | | TmsCarKeyDispatch selectTmsCarKeyDispatchdriverMobile(String driverCode); |
| | | } |
| | |
| | | package com.ruoyi.tms.service; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.tms.domain.TmsCarKeyDispatch; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | /** |
| | |
| | | * @return 结果 |
| | | */ |
| | | public int deleteTmsCarKeyDispatchById(Integer id); |
| | | |
| | | TmsCarKeyDispatch selectTmsCarKeyDispatchdriverMobile(String driverCode); |
| | | |
| | | AjaxResult takeReview(TmsCarKeyDispatch tmsCarKeyDispatch); |
| | | } |
| | |
| | | package com.ruoyi.tms.service.impl; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.scheduling.annotation.Async; |
| | |
| | | { |
| | | return tmsCarKeyDispatchMapper.deleteTmsCarKeyDispatchById(id); |
| | | } |
| | | |
| | | @Override |
| | | public TmsCarKeyDispatch selectTmsCarKeyDispatchdriverMobile(String driverCode) { |
| | | return tmsCarKeyDispatchMapper.selectTmsCarKeyDispatchdriverMobile(driverCode); |
| | | } |
| | | @Override |
| | | public AjaxResult takeReview(TmsCarKeyDispatch tmsCarKeyDispatch) { |
| | | if (tmsCarKeyDispatch == null) { |
| | | return AjaxResult.error("查无符合要求的调度单,请联系调度人员",3); |
| | | } |
| | | if (StringUtils.isEmpty(tmsCarKeyDispatch.getVehicleCarKeyNo())){ |
| | | return AjaxResult.error("车钥匙柜号为空,请联系调度人员",3); |
| | | |
| | | } |
| | | tmsCarKeyDispatch.setStatus(1); |
| | | tmsCarKeyDispatch.setCarKeyCollectionTime(new Date()); |
| | | tmsCarKeyDispatchMapper.updateTmsCarKeyDispatch(tmsCarKeyDispatch); |
| | | |
| | | |
| | | |
| | | |
| | | AjaxResult success = new AjaxResult(0, "成功",1); |
| | | success.put("boxNumber",tmsCarKeyDispatch.getVehicleCarKeyNo()); |
| | | logger.info("成功返回{}",success); |
| | | return success; |
| | | } |
| | | } |
| | |
| | | </where> |
| | | order by thisTab.id desc |
| | | </select> |
| | | <select id="selectTmsCarKeyDispatchdriverMobile" resultMap="TmsCarKeyDispatchResult"> |
| | | <include refid="selectTmsCarKeyDispatchVo"/> |
| | | WHERE |
| | | thisTab.driver_mobile = #{driverCode} |
| | | AND thisTab.status = 0 |
| | | AND thisTab.car_key_expiration_time <= NOW() |
| | | limit 1 |
| | | |
| | | </select> |
| | | |
| | | <!-- 新增 --> |
| | | <insert id="insertTmsCarKeyDispatch" parameterType="com.ruoyi.tms.domain.TmsCarKeyDispatch" useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | </select> |
| | | <select id="selectAssignedItineraryDetail" resultType="com.ruoyi.tms.domain.vo.DriverDispatchVo"> |
| | | SELECT tdo.dispatch_no, tdo.customer_name, tdo.license_plate,tdo.transport_line,tdo.status,tdo.latest_departure, |
| | | tdd.status as tddStatus,tdd.driver_id,tdd.dispatch_id,tdo.ok_time,tdo.shelf_code |
| | | tdd.status as tddStatus,tdd.driver_id,tdd.dispatch_id,tdo.ok_time,tdo.shelf_code,tdo.shipper_address,tdo.receiver_address |
| | | FROM tms_dispatch_order AS tdo |
| | | LEFT JOIN tms_driver_dispatch AS tdd |
| | | ON tdo.id = tdd.dispatch_id |
| | |
| | | if (districtId) data.districtId = districtId; |
| | | if (streetId) data.streetId = streetId; |
| | | } |
| | | listTmsConsignor({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => { |
| | | listTmsConsignor({pageSize: page.pageSize, pageNum: page.currentPage, ...data,customerId: form.value.customerId}).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |
| | |
| | | if (districtId) data.districtId = districtId; |
| | | if (streetId) data.streetId = streetId; |
| | | } |
| | | listTmsConsignor({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => { |
| | | listTmsConsignor({pageSize: page.pageSize, pageNum: page.currentPage, ...data,customerId: form.value.customerId}).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |