Commit 57257640f5149f5db28d46cce52286210342668a
Merge branch 'dev' of http://61.169.120.202:8888/youxiw20000/trash into
dev # Conflicts: # trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderServiceImpl.java
Showing
15 changed files
with
433 additions
and
30 deletions
trash-garbage/src/main/java/com/trash/garbage/controller/GarbageOrderController.java
| @@ -15,6 +15,7 @@ import com.trash.common.core.domain.model.LoginUser; | @@ -15,6 +15,7 @@ import com.trash.common.core.domain.model.LoginUser; | ||
| 15 | import com.trash.common.core.page.PageDomain; | 15 | import com.trash.common.core.page.PageDomain; |
| 16 | import com.trash.common.core.page.TableSupport; | 16 | import com.trash.common.core.page.TableSupport; |
| 17 | import com.trash.common.enums.BusinessType; | 17 | import com.trash.common.enums.BusinessType; |
| 18 | +import com.trash.common.utils.SecurityUtils; | ||
| 18 | import com.trash.common.utils.ServletUtils; | 19 | import com.trash.common.utils.ServletUtils; |
| 19 | import com.trash.common.utils.StringUtils; | 20 | import com.trash.common.utils.StringUtils; |
| 20 | import com.trash.common.utils.file.FileUploadUtils; | 21 | import com.trash.common.utils.file.FileUploadUtils; |
| @@ -27,6 +28,7 @@ import com.trash.framework.web.service.TokenService; | @@ -27,6 +28,7 @@ import com.trash.framework.web.service.TokenService; | ||
| 27 | import com.trash.garbage.custom.BizException; | 28 | import com.trash.garbage.custom.BizException; |
| 28 | import com.trash.garbage.global.Result; | 29 | import com.trash.garbage.global.Result; |
| 29 | import com.trash.garbage.global.ResultCode; | 30 | import com.trash.garbage.global.ResultCode; |
| 31 | +import com.trash.garbage.pojo.domain.DriverSend; | ||
| 30 | import com.trash.garbage.pojo.domain.GarOrder; | 32 | import com.trash.garbage.pojo.domain.GarOrder; |
| 31 | import com.trash.garbage.pojo.domain.GarOrderMatchAsk; | 33 | import com.trash.garbage.pojo.domain.GarOrderMatchAsk; |
| 32 | import com.trash.garbage.pojo.domain.GarOrderMatchDisposal; | 34 | import com.trash.garbage.pojo.domain.GarOrderMatchDisposal; |
| @@ -167,6 +169,46 @@ public class GarbageOrderController { | @@ -167,6 +169,46 @@ public class GarbageOrderController { | ||
| 167 | return Result.OK(garOrderMatchAskService.queryGarOrderMatchAsk(orderId)); | 169 | return Result.OK(garOrderMatchAskService.queryGarOrderMatchAsk(orderId)); |
| 168 | } | 170 | } |
| 169 | 171 | ||
| 172 | + @GetMapping("/queryGarOrderMatchAsks/{orderId}") | ||
| 173 | + public Result<Integer> queryGarOrderMatchAsks(@PathVariable String orderId) { | ||
| 174 | + return Result.OK(garOrderMatchAskService.queryGarOrderMatchAsks(orderId)); | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | + @GetMapping("/queryErrType") | ||
| 178 | + public Result<Integer> queryErrType() { | ||
| 179 | + String phone = SecurityUtils.getLoginUser().getUser().getPhonenumber(); | ||
| 180 | + return Result.OK(garOrderMatchAskService.queryErrType(phone)); | ||
| 181 | + } | ||
| 182 | + | ||
| 183 | + @GetMapping("/queryCarCode") | ||
| 184 | + public Result<List<GarOrderMatchAsk>> queryCarCode(@RequestParam String orderId) { | ||
| 185 | + return Result.OK(garOrderMatchAskService.queryCarCode(orderId)); | ||
| 186 | + } | ||
| 187 | + | ||
| 188 | + @PostMapping("/sendToDriver") | ||
| 189 | + public Result<Integer> sendToDriver(@RequestBody DriverSend driverSend) { | ||
| 190 | + String phone = SecurityUtils.getLoginUser().getUser().getPhonenumber(); | ||
| 191 | + driverSend.setPhone(phone); | ||
| 192 | + driverSend.setState("0"); | ||
| 193 | + return Result.OK(garOrderMatchAskService.addDriverSend(driverSend)); | ||
| 194 | + } | ||
| 195 | + | ||
| 196 | + @PostMapping("/updateDriverSend") | ||
| 197 | + public Result<Integer> updateDriverSend(@RequestBody DriverSend driverSend) { | ||
| 198 | + String phone = SecurityUtils.getLoginUser().getUser().getPhonenumber(); | ||
| 199 | + driverSend.setPhone(phone); | ||
| 200 | + driverSend.setState("1"); | ||
| 201 | + return Result.OK(garOrderMatchAskService.updateDriverSendState(driverSend)); | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + @GetMapping("/queryDriverSend") | ||
| 205 | + public Result<DriverSend> queryDriverSend() { | ||
| 206 | + String phone = SecurityUtils.getLoginUser().getUser().getPhonenumber(); | ||
| 207 | + return Result.OK(garOrderMatchAskService.queryDriverSend(phone)); | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + | ||
| 211 | + | ||
| 170 | @GetMapping("/querySiteByTel") | 212 | @GetMapping("/querySiteByTel") |
| 171 | public Result<List<SiteInfoDTO>> querySiteByTel() { | 213 | public Result<List<SiteInfoDTO>> querySiteByTel() { |
| 172 | // ่ทๅ็ปๅฝ็จๆทๆๆบๅท | 214 | // ่ทๅ็ปๅฝ็จๆทๆๆบๅท |
| @@ -205,6 +247,15 @@ public class GarbageOrderController { | @@ -205,6 +247,15 @@ public class GarbageOrderController { | ||
| 205 | 247 | ||
| 206 | return Result.OK(garOrderService.queryDispatch(orderId)); | 248 | return Result.OK(garOrderService.queryDispatch(orderId)); |
| 207 | } | 249 | } |
| 250 | + @GetMapping("/updateGarRealCarCount") | ||
| 251 | + public Result<?> updateGarRealCarCount(@RequestParam("orderId") String orderId,@RequestParam("garRealCarCount")Integer garRealCarCount) { | ||
| 252 | + return Result.OK(garOrderService.updateGarRealCarCount(orderId, garRealCarCount)); | ||
| 253 | + } | ||
| 254 | + | ||
| 255 | + @GetMapping("/getGarOrderMatchHandlers") | ||
| 256 | + public Result<?> getGarOrderMatchHandlers(@RequestParam("orderId") String orderId) { | ||
| 257 | + return Result.OK(garOrderService.getGarOrderMatchHandlers(orderId)); | ||
| 258 | + } | ||
| 208 | 259 | ||
| 209 | @GetMapping("/queryDispatch/dss/{orderId}") | 260 | @GetMapping("/queryDispatch/dss/{orderId}") |
| 210 | public Result<?> queryDispatchDss(@PathVariable("orderId") String orderId) { | 261 | public Result<?> queryDispatchDss(@PathVariable("orderId") String orderId) { |
trash-garbage/src/main/java/com/trash/garbage/mapper/GarOrderCarMapper.java
| @@ -10,7 +10,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | @@ -10,7 +10,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 10 | * @Entity com.trash.garbage.pojo.domain.GarOrderCar | 10 | * @Entity com.trash.garbage.pojo.domain.GarOrderCar |
| 11 | */ | 11 | */ |
| 12 | public interface GarOrderCarMapper extends BaseMapper<GarOrderCar> { | 12 | public interface GarOrderCarMapper extends BaseMapper<GarOrderCar> { |
| 13 | - | 13 | + GarOrderCar selectByGarOrderId(String garOrderId); |
| 14 | + int insertSelective(GarOrderCar garOrderCar); | ||
| 14 | } | 15 | } |
| 15 | 16 | ||
| 16 | 17 |
trash-garbage/src/main/java/com/trash/garbage/mapper/GarOrderMapper.java
| @@ -46,6 +46,10 @@ public interface GarOrderMapper extends BaseMapper<GarOrder> { | @@ -46,6 +46,10 @@ public interface GarOrderMapper extends BaseMapper<GarOrder> { | ||
| 46 | List<DockingQRCodeEntity> queryReportByCarCode(@Param("carCode") String carCode,@Param("dateStr") String dateStr); | 46 | List<DockingQRCodeEntity> queryReportByCarCode(@Param("carCode") String carCode,@Param("dateStr") String dateStr); |
| 47 | 47 | ||
| 48 | int queryGarRealCarCountByGarOrderId(@Param("garOrderId") String garOrderId); | 48 | int queryGarRealCarCountByGarOrderId(@Param("garOrderId") String garOrderId); |
| 49 | + | ||
| 50 | + int updateGarRealCarCount(@Param("garOrderId") String garOrderId,@Param("garRealCarCount") Integer garRealCarCount); | ||
| 51 | + | ||
| 52 | + int queryGarNowCarCount(@Param("garOrderId") String garOrderId); | ||
| 49 | } | 53 | } |
| 50 | 54 | ||
| 51 | 55 |
trash-garbage/src/main/java/com/trash/garbage/mapper/GarOrderMatchAskMapper.java
| @@ -2,8 +2,7 @@ package com.trash.garbage.mapper; | @@ -2,8 +2,7 @@ package com.trash.garbage.mapper; | ||
| 2 | 2 | ||
| 3 | import com.trash.garbage.pojo.domain.GarOrderMatchAsk; | 3 | import com.trash.garbage.pojo.domain.GarOrderMatchAsk; |
| 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| 5 | -import com.trash.garbage.pojo.vo.DispatchDisposalVo; | ||
| 6 | -import org.apache.ibatis.annotations.Param; | 5 | +import com.trash.garbage.pojo.domain.DriverSend; |
| 7 | 6 | ||
| 8 | import java.util.List; | 7 | import java.util.List; |
| 9 | 8 | ||
| @@ -64,6 +63,20 @@ public interface GarOrderMatchAskMapper extends BaseMapper<GarOrderMatchAsk> { | @@ -64,6 +63,20 @@ public interface GarOrderMatchAskMapper extends BaseMapper<GarOrderMatchAsk> { | ||
| 64 | int deleteGarOrderMatchAskByIds(String[] garIds); | 63 | int deleteGarOrderMatchAskByIds(String[] garIds); |
| 65 | 64 | ||
| 66 | int queryGarOrderMatchAsk(String orderId); | 65 | int queryGarOrderMatchAsk(String orderId); |
| 66 | + | ||
| 67 | + int queryGarOrderMatchAsks(String orderId); | ||
| 68 | + | ||
| 69 | + int queryErrType(String phone); | ||
| 70 | + | ||
| 71 | + GarOrderMatchAsk selectByGarOrderAskId(String garOrderId); | ||
| 72 | + | ||
| 73 | + List<GarOrderMatchAsk> queryCarCode(String orderId); | ||
| 74 | + | ||
| 75 | + int insertGarOrderMatchAskBySelect(GarOrderMatchAsk garOrderMatchAsk); | ||
| 76 | + | ||
| 77 | + int addDriverSend(DriverSend driverSend); | ||
| 78 | + int updateDriverSendState(DriverSend driverSend); | ||
| 79 | + DriverSend queryDriverSend(String phoneNumber); | ||
| 67 | } | 80 | } |
| 68 | 81 | ||
| 69 | 82 |
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/DriverSend.java
0 โ 100644
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrder.java
| @@ -192,7 +192,44 @@ public class GarOrder implements Serializable { | @@ -192,7 +192,44 @@ public class GarOrder implements Serializable { | ||
| 192 | 192 | ||
| 193 | private String garAskStatus; | 193 | private String garAskStatus; |
| 194 | 194 | ||
| 195 | - /** | 195 | + @TableField(exist = false) |
| 196 | + private Integer garNowCarCount; | ||
| 197 | + | ||
| 198 | + | ||
| 199 | + | ||
| 200 | + public String getGarOrderHandlerStatusStr() { | ||
| 201 | + return garOrderHandlerStatusStr; | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + public void setGarOrderHandlerStatusStr(String garOrderHandlerStatusStr) { | ||
| 205 | + this.garOrderHandlerStatusStr = garOrderHandlerStatusStr; | ||
| 206 | + } | ||
| 207 | + | ||
| 208 | + public String getGarCancelFlagStr() { | ||
| 209 | + return garCancelFlagStr; | ||
| 210 | + } | ||
| 211 | + | ||
| 212 | + public void setGarCancelFlagStr(String garCancelFlagStr) { | ||
| 213 | + this.garCancelFlagStr = garCancelFlagStr; | ||
| 214 | + } | ||
| 215 | + | ||
| 216 | + public Boolean getNeedFollowCar() { | ||
| 217 | + return needFollowCar; | ||
| 218 | + } | ||
| 219 | + | ||
| 220 | + public void setNeedFollowCar(Boolean needFollowCar) { | ||
| 221 | + this.needFollowCar = needFollowCar; | ||
| 222 | + } | ||
| 223 | + | ||
| 224 | + public Integer getGarNowCarCount() { | ||
| 225 | + return garNowCarCount; | ||
| 226 | + } | ||
| 227 | + | ||
| 228 | + public void setGarNowCarCount(Integer garNowCarCount) { | ||
| 229 | + this.garNowCarCount = garNowCarCount; | ||
| 230 | + } | ||
| 231 | + | ||
| 232 | + /** | ||
| 196 | * ๆฏๅฆๆ็จๆท็่ฏไปท๏ผ้ป่ฎคๅผๆฏ0๏ผ้ป่ฎคๆฒกๆ | 233 | * ๆฏๅฆๆ็จๆท็่ฏไปท๏ผ้ป่ฎคๅผๆฏ0๏ผ้ป่ฎคๆฒกๆ |
| 197 | * | 234 | * |
| 198 | * @author liujun | 235 | * @author liujun |
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderMatchAskService.java
| 1 | package com.trash.garbage.service; | 1 | package com.trash.garbage.service; |
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.extension.service.IService; | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
| 4 | +import com.trash.garbage.pojo.domain.DriverSend; | ||
| 4 | import com.trash.garbage.pojo.domain.GarOrderMatchAsk; | 5 | import com.trash.garbage.pojo.domain.GarOrderMatchAsk; |
| 5 | import com.trash.garbage.pojo.vo.DispatchDisposalVo; | 6 | import com.trash.garbage.pojo.vo.DispatchDisposalVo; |
| 6 | 7 | ||
| @@ -63,4 +64,20 @@ public interface GarOrderMatchAskService extends IService<GarOrderMatchAsk> { | @@ -63,4 +64,20 @@ public interface GarOrderMatchAskService extends IService<GarOrderMatchAsk> { | ||
| 63 | int deleteGarOrderMatchAskById(String garId); | 64 | int deleteGarOrderMatchAskById(String garId); |
| 64 | 65 | ||
| 65 | int queryGarOrderMatchAsk(String orderId); | 66 | int queryGarOrderMatchAsk(String orderId); |
| 67 | + | ||
| 68 | + int queryGarOrderMatchAsks(String orderId); | ||
| 69 | + | ||
| 70 | + List<GarOrderMatchAsk> queryCarCode(String orderId); | ||
| 71 | + | ||
| 72 | + int queryErrType(String phone); | ||
| 73 | + | ||
| 74 | + GarOrderMatchAsk selectByGarOrderAskId(String garOrderId); | ||
| 75 | + | ||
| 76 | + int insertGarOrderMatchAskBySelect(GarOrderMatchAsk garOrderMatchAsk); | ||
| 77 | + | ||
| 78 | + int addDriverSend(DriverSend driverSend); | ||
| 79 | + | ||
| 80 | + int updateDriverSendState(DriverSend driverSend); | ||
| 81 | + | ||
| 82 | + DriverSend queryDriverSend(String phone); | ||
| 66 | } | 83 | } |
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderService.java
| @@ -9,6 +9,7 @@ import com.trash.garbage.pojo.domain.GarOrderEvaluate; | @@ -9,6 +9,7 @@ import com.trash.garbage.pojo.domain.GarOrderEvaluate; | ||
| 9 | import com.trash.garbage.pojo.domain.GarOrderMatchHandler; | 9 | import com.trash.garbage.pojo.domain.GarOrderMatchHandler; |
| 10 | import com.trash.garbage.pojo.dto.*; | 10 | import com.trash.garbage.pojo.dto.*; |
| 11 | import com.trash.garbage.pojo.vo.*; | 11 | import com.trash.garbage.pojo.vo.*; |
| 12 | +import org.apache.ibatis.annotations.Param; | ||
| 12 | 13 | ||
| 13 | import java.util.List; | 14 | import java.util.List; |
| 14 | 15 | ||
| @@ -112,4 +113,8 @@ public interface GarOrderService extends IService<GarOrder> { | @@ -112,4 +113,8 @@ public interface GarOrderService extends IService<GarOrder> { | ||
| 112 | 113 | ||
| 113 | Integer queryGarRealCarCountByGarOrderId(String garOrderId); | 114 | Integer queryGarRealCarCountByGarOrderId(String garOrderId); |
| 114 | 115 | ||
| 116 | + int updateGarRealCarCount(String garOrderId,Integer garRealCarCount); | ||
| 117 | + | ||
| 118 | + List<GarOrderMatchHandler> getGarOrderMatchHandlers(String garOrderId); | ||
| 119 | + | ||
| 115 | } | 120 | } |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderMatchAskServiceImpl.java
| @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| 5 | import com.trash.garbage.mapper.GarOrderMapper; | 5 | import com.trash.garbage.mapper.GarOrderMapper; |
| 6 | import com.trash.garbage.mapper.GarOrderMatchAskMapper; | 6 | import com.trash.garbage.mapper.GarOrderMatchAskMapper; |
| 7 | +import com.trash.garbage.pojo.domain.DriverSend; | ||
| 7 | import com.trash.garbage.pojo.domain.GarOrderMatchAsk; | 8 | import com.trash.garbage.pojo.domain.GarOrderMatchAsk; |
| 8 | import com.trash.garbage.pojo.vo.OrderDetailTransportVo; | 9 | import com.trash.garbage.pojo.vo.OrderDetailTransportVo; |
| 9 | import com.trash.garbage.service.GarOrderMatchAskService; | 10 | import com.trash.garbage.service.GarOrderMatchAskService; |
| @@ -120,6 +121,37 @@ public class GarOrderMatchAskServiceImpl extends ServiceImpl<GarOrderMatchAskMap | @@ -120,6 +121,37 @@ public class GarOrderMatchAskServiceImpl extends ServiceImpl<GarOrderMatchAskMap | ||
| 120 | public int queryGarOrderMatchAsk(String orderId) { | 121 | public int queryGarOrderMatchAsk(String orderId) { |
| 121 | return garOrderMatchAskMapper.queryGarOrderMatchAsk(orderId); | 122 | return garOrderMatchAskMapper.queryGarOrderMatchAsk(orderId); |
| 122 | } | 123 | } |
| 124 | + | ||
| 125 | + @Override | ||
| 126 | + public int queryGarOrderMatchAsks(String orderId){ | ||
| 127 | + return garOrderMatchAskMapper.queryGarOrderMatchAsks(orderId); | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + public GarOrderMatchAsk selectByGarOrderAskId(String garOrderId){ | ||
| 131 | + return garOrderMatchAskMapper.selectByGarOrderAskId(garOrderId); | ||
| 132 | + }; | ||
| 133 | + | ||
| 134 | + public int insertGarOrderMatchAskBySelect(GarOrderMatchAsk garOrderMatchAsk){ | ||
| 135 | + return garOrderMatchAskMapper.insertGarOrderMatchAskBySelect(garOrderMatchAsk); | ||
| 136 | + }; | ||
| 137 | + | ||
| 138 | + public int addDriverSend(DriverSend driverSend){ | ||
| 139 | + return garOrderMatchAskMapper.addDriverSend(driverSend); | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + public int updateDriverSendState(DriverSend driverSend){ | ||
| 143 | + return garOrderMatchAskMapper.updateDriverSendState(driverSend); | ||
| 144 | + }; | ||
| 145 | + public DriverSend queryDriverSend(String phone){ | ||
| 146 | + return garOrderMatchAskMapper.queryDriverSend(phone); | ||
| 147 | + }; | ||
| 148 | + | ||
| 149 | + public List<GarOrderMatchAsk> queryCarCode(String orderId){ | ||
| 150 | + return garOrderMatchAskMapper.queryCarCode(orderId); | ||
| 151 | + } | ||
| 152 | + public int queryErrType(String phone){ | ||
| 153 | + return garOrderMatchAskMapper.queryErrType(phone); | ||
| 154 | + } | ||
| 123 | } | 155 | } |
| 124 | 156 | ||
| 125 | 157 |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderServiceImpl.java
| @@ -30,7 +30,10 @@ import com.trash.enterprise.service.ITransportationEnterpriseService; | @@ -30,7 +30,10 @@ import com.trash.enterprise.service.ITransportationEnterpriseService; | ||
| 30 | import com.trash.garbage.custom.BizException; | 30 | import com.trash.garbage.custom.BizException; |
| 31 | import com.trash.garbage.global.GlobalStatus; | 31 | import com.trash.garbage.global.GlobalStatus; |
| 32 | import com.trash.garbage.global.ResultCode; | 32 | import com.trash.garbage.global.ResultCode; |
| 33 | +import com.trash.garbage.mapper.GarOrderCarMapper; | ||
| 33 | import com.trash.garbage.mapper.GarOrderMapper; | 34 | import com.trash.garbage.mapper.GarOrderMapper; |
| 35 | +import com.trash.garbage.mapper.GarOrderMatchAskMapper; | ||
| 36 | +import com.trash.garbage.mapper.GarOrderMatchHandlerMapper; | ||
| 34 | import com.trash.garbage.pojo.domain.*; | 37 | import com.trash.garbage.pojo.domain.*; |
| 35 | import com.trash.garbage.pojo.dto.*; | 38 | import com.trash.garbage.pojo.dto.*; |
| 36 | import com.trash.garbage.pojo.vo.*; | 39 | import com.trash.garbage.pojo.vo.*; |
| @@ -43,6 +46,7 @@ import org.apache.commons.lang3.StringUtils; | @@ -43,6 +46,7 @@ import org.apache.commons.lang3.StringUtils; | ||
| 43 | import org.apache.commons.lang3.time.DateUtils; | 46 | import org.apache.commons.lang3.time.DateUtils; |
| 44 | import org.apache.commons.lang3.time.FastDateFormat; | 47 | import org.apache.commons.lang3.time.FastDateFormat; |
| 45 | import org.apache.http.client.utils.HttpClientUtils; | 48 | import org.apache.http.client.utils.HttpClientUtils; |
| 49 | +import org.jetbrains.annotations.NotNull; | ||
| 46 | import org.springframework.beans.BeanUtils; | 50 | import org.springframework.beans.BeanUtils; |
| 47 | import org.springframework.beans.factory.annotation.Autowired; | 51 | import org.springframework.beans.factory.annotation.Autowired; |
| 48 | import org.springframework.beans.factory.annotation.Value; | 52 | import org.springframework.beans.factory.annotation.Value; |
| @@ -109,9 +113,10 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | @@ -109,9 +113,10 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | ||
| 109 | private GarAreaServer garAreaServer; | 113 | private GarAreaServer garAreaServer; |
| 110 | @Autowired | 114 | @Autowired |
| 111 | private GarOrderAssociationServiceAsync garOrderAssociationServiceAsync; | 115 | private GarOrderAssociationServiceAsync garOrderAssociationServiceAsync; |
| 112 | - | ||
| 113 | @Autowired | 116 | @Autowired |
| 114 | private CarInfoMapper carInfoMapper; | 117 | private CarInfoMapper carInfoMapper; |
| 118 | + @Autowired | ||
| 119 | + private GarOrderCarMapper garOrderCarMapper; | ||
| 115 | 120 | ||
| 116 | private FastDateFormat fastDateFormat = FastDateFormat.getInstance("yyyy-MM-dd"); | 121 | private FastDateFormat fastDateFormat = FastDateFormat.getInstance("yyyy-MM-dd"); |
| 117 | 122 | ||
| @@ -128,6 +133,10 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | @@ -128,6 +133,10 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | ||
| 128 | private IDropPointInfoService dropPointInfoService; | 133 | private IDropPointInfoService dropPointInfoService; |
| 129 | @Autowired | 134 | @Autowired |
| 130 | private com.trash.common.config.trashConfig trashConfig; | 135 | private com.trash.common.config.trashConfig trashConfig; |
| 136 | + @Autowired | ||
| 137 | + private GarOrderMatchAskMapper garOrderMatchAskMapper; | ||
| 138 | + @Autowired | ||
| 139 | + private GarOrderMatchHandlerMapper garOrderMatchHandlerMapper; | ||
| 131 | 140 | ||
| 132 | @Override | 141 | @Override |
| 133 | @Transactional(rollbackFor = Exception.class) | 142 | @Transactional(rollbackFor = Exception.class) |
| @@ -350,6 +359,9 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | @@ -350,6 +359,9 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | ||
| 350 | .eq(GarOrder::getGarTimeOutFlag, GlobalStatus.GarOrderStatus.ORDER_TIME_OUT_FLAG_NO.getValue()); | 359 | .eq(GarOrder::getGarTimeOutFlag, GlobalStatus.GarOrderStatus.ORDER_TIME_OUT_FLAG_NO.getValue()); |
| 351 | } | 360 | } |
| 352 | List<GarOrder> orderList = list(qw); | 361 | List<GarOrder> orderList = list(qw); |
| 362 | + orderList.stream().forEach(s->{ | ||
| 363 | + s.setGarNowCarCount(baseMapper.queryGarNowCarCount(s.getGarOrderId())); | ||
| 364 | + }); | ||
| 353 | PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize); | 365 | PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize); |
| 354 | return pageInfo; | 366 | return pageInfo; |
| 355 | } | 367 | } |
| @@ -357,6 +369,9 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | @@ -357,6 +369,9 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | ||
| 357 | // ๅ จ้จ | 369 | // ๅ จ้จ |
| 358 | if (GlobalStatus.GarOrderStatus.ALL_ORDER.getValue().equals(type)) { | 370 | if (GlobalStatus.GarOrderStatus.ALL_ORDER.getValue().equals(type)) { |
| 359 | List<GarOrder> orderList = list(qw); | 371 | List<GarOrder> orderList = list(qw); |
| 372 | + orderList.stream().forEach(s->{ | ||
| 373 | + s.setGarNowCarCount(baseMapper.queryGarNowCarCount(s.getGarOrderId())); | ||
| 374 | + }); | ||
| 360 | PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize); | 375 | PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize); |
| 361 | return pageInfo; | 376 | return pageInfo; |
| 362 | } | 377 | } |
| @@ -368,6 +383,9 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | @@ -368,6 +383,9 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | ||
| 368 | || GlobalStatus.GarOrderStatus.ACTIVE_ORDER.getValue().equals(type) | 383 | || GlobalStatus.GarOrderStatus.ACTIVE_ORDER.getValue().equals(type) |
| 369 | || GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue().equals(type)) { | 384 | || GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue().equals(type)) { |
| 370 | List<GarOrderDriverVo> orderList = baseMapper.queryDriverOrderListByTelWithType(user.getGarUserTel(), type, GlobalStatus.GarOrderStatus.CANCEL_FLAG_NO.getValue()); | 385 | List<GarOrderDriverVo> orderList = baseMapper.queryDriverOrderListByTelWithType(user.getGarUserTel(), type, GlobalStatus.GarOrderStatus.CANCEL_FLAG_NO.getValue()); |
| 386 | + orderList.stream().forEach(s->{ | ||
| 387 | + s.setGarNowCarCount(baseMapper.queryGarNowCarCount(s.getGarOrderId())); | ||
| 388 | + }); | ||
| 371 | PageInfo<GarOrderDriverVo> pageInfo = new PageInfo<GarOrderDriverVo>(orderList, pageSize); | 389 | PageInfo<GarOrderDriverVo> pageInfo = new PageInfo<GarOrderDriverVo>(orderList, pageSize); |
| 372 | return pageInfo; | 390 | return pageInfo; |
| 373 | } | 391 | } |
| @@ -395,10 +413,16 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | @@ -395,10 +413,16 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | ||
| 395 | .eq(GarOrder::getGarTimeOutFlag, GlobalStatus.GarOrderStatus.ORDER_TIME_OUT_FLAG_NO.getValue()); | 413 | .eq(GarOrder::getGarTimeOutFlag, GlobalStatus.GarOrderStatus.ORDER_TIME_OUT_FLAG_NO.getValue()); |
| 396 | } | 414 | } |
| 397 | List<GarOrder> orderList = list(qw); | 415 | List<GarOrder> orderList = list(qw); |
| 416 | + | ||
| 417 | + orderList.stream().forEach(s->{ | ||
| 418 | + s.setGarNowCarCount(baseMapper.queryGarNowCarCount(s.getGarOrderId())); | ||
| 419 | + }); | ||
| 420 | + | ||
| 398 | orderList = queryHaveEvaluateOfClient(orderList, GlobalStatus.GarOrderStatus.EVALUATE_TYPE_COMPANY.getValue()); | 421 | orderList = queryHaveEvaluateOfClient(orderList, GlobalStatus.GarOrderStatus.EVALUATE_TYPE_COMPANY.getValue()); |
| 399 | PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize); | 422 | PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize); |
| 400 | return pageInfo; | 423 | return pageInfo; |
| 401 | } | 424 | } |
| 425 | + | ||
| 402 | // ๅ จ้จ | 426 | // ๅ จ้จ |
| 403 | if (GlobalStatus.GarOrderStatus.ALL_ORDER.getValue().equals(type)) { | 427 | if (GlobalStatus.GarOrderStatus.ALL_ORDER.getValue().equals(type)) { |
| 404 | List<GarOrder> orderList = baseMapper.selectList(qw); | 428 | List<GarOrder> orderList = baseMapper.selectList(qw); |
| @@ -1431,7 +1455,6 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | @@ -1431,7 +1455,6 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | ||
| 1431 | // TODO ็ญไฟก้็ฅ | 1455 | // TODO ็ญไฟก้็ฅ |
| 1432 | smsUtils.sendMessage(tels, content); | 1456 | smsUtils.sendMessage(tels, content); |
| 1433 | } | 1457 | } |
| 1434 | - | ||
| 1435 | } | 1458 | } |
| 1436 | 1459 | ||
| 1437 | private GarOrderMatchDisposal getGarOrderMatchDisposal(GarOrder order, DisposalDispatchDto.DispatchDetail detail) { | 1460 | private GarOrderMatchDisposal getGarOrderMatchDisposal(GarOrder order, DisposalDispatchDto.DispatchDetail detail) { |
| @@ -1780,6 +1803,81 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | @@ -1780,6 +1803,81 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | ||
| 1780 | .set(dto.getEvaluateType().equals(GlobalStatus.GarOrderStatus.EVALUATE_TYPE_USER.getValue()), GarOrder::getGarHandlerEvaluateFlag, GlobalStatus.GarOrderStatus.EVALUATE_ORDER_YES.getValue()); | 1803 | .set(dto.getEvaluateType().equals(GlobalStatus.GarOrderStatus.EVALUATE_TYPE_USER.getValue()), GarOrder::getGarHandlerEvaluateFlag, GlobalStatus.GarOrderStatus.EVALUATE_ORDER_YES.getValue()); |
| 1781 | update(uw); | 1804 | update(uw); |
| 1782 | } | 1805 | } |
| 1806 | + | ||
| 1807 | + public int updateGarRealCarCount(String garOrderId,Integer garRealCarCount){ | ||
| 1808 | + GarOrderCar originalCar = garOrderCarMapper.selectByGarOrderId(garOrderId); | ||
| 1809 | + GarOrderMatchAsk garOrderMatchAsk = garOrderMatchAskMapper.selectByGarOrderAskId(garOrderId); | ||
| 1810 | + if (originalCar != null && garRealCarCount != null && garRealCarCount > 0) { | ||
| 1811 | + for (int i = 0; i < garRealCarCount; i++) { | ||
| 1812 | + GarOrderCar newCar = getGarOrderCar(originalCar); | ||
| 1813 | + garOrderCarMapper.insertSelective(newCar); | ||
| 1814 | + if(garOrderMatchAsk != null){ | ||
| 1815 | + GarOrderMatchAsk newAsk = getGarOrderMatchAsk(garOrderMatchAsk); | ||
| 1816 | + garOrderMatchAskMapper.insertGarOrderMatchAskBySelect(newAsk); | ||
| 1817 | + } | ||
| 1818 | + } | ||
| 1819 | + } | ||
| 1820 | + return baseMapper.updateGarRealCarCount(garOrderId,garRealCarCount); | ||
| 1821 | + } | ||
| 1822 | + | ||
| 1823 | + public List<GarOrderMatchHandler> getGarOrderMatchHandlers(String garOrderId){ | ||
| 1824 | + System.out.println(garOrderMatchHandlerMapper.queryGarOrderMatchHandler(garOrderId)); | ||
| 1825 | + return garOrderMatchHandlerMapper.queryGarOrderMatchHandler(garOrderId); | ||
| 1826 | + } | ||
| 1827 | + | ||
| 1828 | + @NotNull | ||
| 1829 | + private static GarOrderCar getGarOrderCar(GarOrderCar originalCar) { | ||
| 1830 | + GarOrderCar newCar = new GarOrderCar(); | ||
| 1831 | + newCar.setGarOrderId(originalCar.getGarOrderId()); | ||
| 1832 | + newCar.setGarOrderCarType(originalCar.getGarOrderCarType()); | ||
| 1833 | + newCar.setCarId(originalCar.getCarId()); | ||
| 1834 | + newCar.setContainerVolume(originalCar.getContainerVolume()); | ||
| 1835 | + newCar.setGarCreateBy(originalCar.getGarCreateBy()); | ||
| 1836 | + newCar.setGarUpdateBy(originalCar.getGarUpdateBy()); | ||
| 1837 | + newCar.setGarOrderCarUserType(originalCar.getGarOrderCarUserType()); | ||
| 1838 | + newCar.setGarId(null); | ||
| 1839 | + newCar.setGarCreateTime(new Date()); | ||
| 1840 | + newCar.setGarUpdateTime(new Date()); | ||
| 1841 | + return newCar; | ||
| 1842 | + } | ||
| 1843 | + | ||
| 1844 | + @NotNull | ||
| 1845 | + private static GarOrderMatchAsk getGarOrderMatchAsk(GarOrderMatchAsk garOrderMatchAsk) { | ||
| 1846 | + | ||
| 1847 | + GarOrderMatchAsk newCar = new GarOrderMatchAsk(); | ||
| 1848 | + newCar.setGarId(String.valueOf(Long.parseLong(garOrderMatchAsk.getGarId()) + 1)); | ||
| 1849 | + newCar.setGarOrderId(garOrderMatchAsk.getGarOrderId()); | ||
| 1850 | + newCar.setGarCreateTime(new Date()); | ||
| 1851 | + newCar.setGarCreateBy(garOrderMatchAsk.getGarCreateBy()); | ||
| 1852 | + newCar.setGarUpdateBy(garOrderMatchAsk.getGarUpdateBy()); | ||
| 1853 | + newCar.setDropPointId(garOrderMatchAsk.getDropPointId()); | ||
| 1854 | + newCar.setDropPointName(garOrderMatchAsk.getDropPointName()); | ||
| 1855 | + newCar.setGarOrderType(garOrderMatchAsk.getGarOrderType()); | ||
| 1856 | + newCar.setDisposalId(garOrderMatchAsk.getDisposalId()); | ||
| 1857 | + newCar.setDisposalSiteName(garOrderMatchAsk.getDisposalSiteName()); | ||
| 1858 | + String orderNumber = garOrderMatchAsk.getGarOrderNumber(); | ||
| 1859 | + if (orderNumber != null && orderNumber.length() >= 2) { | ||
| 1860 | + try { | ||
| 1861 | + String prefix = orderNumber.substring(0, orderNumber.length() - 2); | ||
| 1862 | + String suffix = orderNumber.substring(orderNumber.length() - 2); | ||
| 1863 | + int suffixNum = Integer.parseInt(suffix); | ||
| 1864 | + String newSuffix = String.format("%02d", (suffixNum + 1) % 100); | ||
| 1865 | + newCar.setGarOrderNumber(prefix + newSuffix); | ||
| 1866 | + } catch (Exception e) { | ||
| 1867 | + newCar.setGarOrderNumber(orderNumber); | ||
| 1868 | + } | ||
| 1869 | + } else { | ||
| 1870 | + newCar.setGarOrderNumber(orderNumber); | ||
| 1871 | + } | ||
| 1872 | + newCar.setGarOrderPhone(garOrderMatchAsk.getGarOrderPhone()); | ||
| 1873 | + newCar.setGarOrderName(garOrderMatchAsk.getGarOrderName()); | ||
| 1874 | + newCar.setDropAddress(garOrderMatchAsk.getDropAddress()); | ||
| 1875 | + newCar.setDropCarNum(0); | ||
| 1876 | + newCar.setGarOrderTime(new Date()); | ||
| 1877 | + return newCar; | ||
| 1878 | + } | ||
| 1879 | + | ||
| 1880 | + | ||
| 1783 | } | 1881 | } |
| 1784 | 1882 | ||
| 1785 | 1883 |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarUserServiceImpl.java
| @@ -140,29 +140,40 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> | @@ -140,29 +140,40 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> | ||
| 140 | throw new BizException(ResultCode.CODE_500, "่งฃๅฏๅคฑ่ดฅ"); | 140 | throw new BizException(ResultCode.CODE_500, "่งฃๅฏๅคฑ่ดฅ"); |
| 141 | } | 141 | } |
| 142 | } | 142 | } |
| 143 | - | ||
| 144 | - // ๆฅ่ฏข็จๆท | ||
| 145 | - QueryWrapper<GarUser> qw = new QueryWrapper<>(); | 143 | + |
| 146 | GarUser nUser = null; | 144 | GarUser nUser = null; |
| 147 | - qw.lambda().eq(GarUser::getGarUserTel, loginDto.getTel()); | ||
| 148 | - if(loginDto.getCode() == null && loginDto.getPassword() != null){ | ||
| 149 | - qw.lambda().eq(GarUser::getGarUserTel, loginDto.getTel()); | ||
| 150 | - if(loginDto.getSignin() != 1){ | ||
| 151 | - nUser = this.getOne(qw); | ||
| 152 | - if (Objects.isNull(nUser)) { | ||
| 153 | - throw new UsernameNotFoundException("ๅฝๅ็จๆทไธๅญๅจ!"); | ||
| 154 | - } | ||
| 155 | - if(!new BCryptPasswordEncoder().matches(loginDto.getPassword(),nUser.getPassword())){ | ||
| 156 | - throw new UsernameNotFoundException("ๅฏ็ ้่ฏฏ!"); | ||
| 157 | - } | ||
| 158 | - } | ||
| 159 | - }else{ | ||
| 160 | - // ้ช่ฏ็ ้ช่ฏ | ||
| 161 | - String code = redisCache.getCacheObject(GlobalRedisProperties.REDIS_USER_CODE.getValue() + loginDto.getTel()); | ||
| 162 | - if (loginDto.getCode() == null || !loginDto.getCode().equals(code)) { | ||
| 163 | - throw new BizException(ResultCode.CODE_400, "้ช่ฏ็ ้่ฏฏ๏ผ๏ผ"); | ||
| 164 | - } | 145 | + if (loginDto.getSignin() != 1 && StringUtils.isNotEmpty(loginDto.getNickname())) { |
| 146 | + QueryWrapper<GarUser> qw = new QueryWrapper<>(); | ||
| 147 | + qw.lambda().eq(GarUser::getGarUserName, loginDto.getNickname()); | ||
| 165 | nUser = this.getOne(qw); | 148 | nUser = this.getOne(qw); |
| 149 | + if (Objects.isNull(nUser)) { | ||
| 150 | + throw new UsernameNotFoundException("ๅฝๅ็จๆทไธๅญๅจ!"); | ||
| 151 | + } | ||
| 152 | + if (!new BCryptPasswordEncoder().matches(loginDto.getPassword(), nUser.getPassword())) { | ||
| 153 | + throw new UsernameNotFoundException("ๅฏ็ ้่ฏฏ!"); | ||
| 154 | + } | ||
| 155 | + loginDto.setTel(nUser.getGarUserTel()); | ||
| 156 | + } else { | ||
| 157 | + QueryWrapper<GarUser> qw = new QueryWrapper<>(); | ||
| 158 | + qw.lambda().eq(GarUser::getGarUserTel, loginDto.getTel()); | ||
| 159 | + if(loginDto.getCode() == null && loginDto.getPassword() != null){ | ||
| 160 | + qw.lambda().eq(GarUser::getGarUserTel, loginDto.getTel()); | ||
| 161 | + if(loginDto.getSignin() != 1){ | ||
| 162 | + nUser = this.getOne(qw); | ||
| 163 | + if (Objects.isNull(nUser)) { | ||
| 164 | + throw new UsernameNotFoundException("ๅฝๅ็จๆทไธๅญๅจ!"); | ||
| 165 | + } | ||
| 166 | + if(!new BCryptPasswordEncoder().matches(loginDto.getPassword(),nUser.getPassword())){ | ||
| 167 | + throw new UsernameNotFoundException("ๅฏ็ ้่ฏฏ!"); | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | + }else{ | ||
| 171 | + String code = redisCache.getCacheObject(GlobalRedisProperties.REDIS_USER_CODE.getValue() + loginDto.getTel()); | ||
| 172 | + if (loginDto.getCode() == null || !loginDto.getCode().equals(code)) { | ||
| 173 | + throw new BizException(ResultCode.CODE_400, "้ช่ฏ็ ้่ฏฏ๏ผ๏ผ"); | ||
| 174 | + } | ||
| 175 | + nUser = this.getOne(qw); | ||
| 176 | + } | ||
| 166 | } | 177 | } |
| 167 | 178 | ||
| 168 | if (Objects.isNull(nUser)) { | 179 | if (Objects.isNull(nUser)) { |
| @@ -287,9 +298,8 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> | @@ -287,9 +298,8 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> | ||
| 287 | //้ๆบ็ๆ6ไฝๆฐๅญ้ช่ฏ็ | 298 | //้ๆบ็ๆ6ไฝๆฐๅญ้ช่ฏ็ |
| 288 | String validateCode = ValidateCodeUtil.generatorCode(4); | 299 | String validateCode = ValidateCodeUtil.generatorCode(4); |
| 289 | //็ป็จๆทๅ้้ช่ฏ็ | 300 | //็ป็จๆทๅ้้ช่ฏ็ |
| 290 | -// SMSUtils.sendMessage("", tel, validateCode.toString(), ""); | 301 | + smsUtils.sendMessage(tel, validateCode.toString()); |
| 291 | // ไฟๅญredis | 302 | // ไฟๅญredis |
| 292 | - System.out.println("code:" + validateCode); | ||
| 293 | redisCache.setCacheObject(GlobalRedisProperties.REDIS_USER_CODE.getValue() + tel, validateCode, 60, TimeUnit.SECONDS); | 303 | redisCache.setCacheObject(GlobalRedisProperties.REDIS_USER_CODE.getValue() + tel, validateCode, 60, TimeUnit.SECONDS); |
| 294 | return validateCode; | 304 | return validateCode; |
| 295 | } | 305 | } |
trash-garbage/src/main/resources/mapper/GarOrderCarMapper.xml
| @@ -14,6 +14,8 @@ | @@ -14,6 +14,8 @@ | ||
| 14 | <result property="garCreateBy" column="gar_create_by" jdbcType="VARCHAR"/> | 14 | <result property="garCreateBy" column="gar_create_by" jdbcType="VARCHAR"/> |
| 15 | <result property="garUpdateBy" column="gar_update_by" jdbcType="VARCHAR"/> | 15 | <result property="garUpdateBy" column="gar_update_by" jdbcType="VARCHAR"/> |
| 16 | <result property="garRemark" column="gar_remark" jdbcType="VARCHAR"/> | 16 | <result property="garRemark" column="gar_remark" jdbcType="VARCHAR"/> |
| 17 | + <result property="carId" column="car_id" jdbcType="VARCHAR"/> | ||
| 18 | + <result property="containerVolume" column="container_volume" jdbcType="VARCHAR"/> | ||
| 17 | </resultMap> | 19 | </resultMap> |
| 18 | 20 | ||
| 19 | <sql id="Base_Column_List"> | 21 | <sql id="Base_Column_List"> |
| @@ -21,4 +23,42 @@ | @@ -21,4 +23,42 @@ | ||
| 21 | gar_order_car_user_type,gar_create_time,gar_update_time, | 23 | gar_order_car_user_type,gar_create_time,gar_update_time, |
| 22 | gar_create_by,gar_update_by,gar_remark | 24 | gar_create_by,gar_update_by,gar_remark |
| 23 | </sql> | 25 | </sql> |
| 26 | + <select id="selectByGarOrderId" parameterType="string" resultMap="BaseResultMap"> | ||
| 27 | + SELECT gar_id,gar_order_id,gar_order_car_type, | ||
| 28 | + gar_order_car_user_type,gar_create_time,gar_update_time, | ||
| 29 | + gar_create_by,gar_update_by,gar_remark,car_id,container_volume | ||
| 30 | + FROM gar_order_car | ||
| 31 | + WHERE gar_order_id = #{garOrderId} | ||
| 32 | + LIMIT 1 | ||
| 33 | + </select> | ||
| 34 | + | ||
| 35 | + <insert id="insertSelective" parameterType="com.trash.garbage.pojo.domain.GarOrderCar"> | ||
| 36 | + INSERT INTO gar_order_car | ||
| 37 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
| 38 | + gar_id, | ||
| 39 | + gar_order_id, | ||
| 40 | + gar_order_car_type, | ||
| 41 | + gar_order_car_user_type, | ||
| 42 | + gar_create_time, | ||
| 43 | + gar_update_time, | ||
| 44 | + gar_create_by, | ||
| 45 | + gar_update_by, | ||
| 46 | + gar_remark, | ||
| 47 | + car_id, | ||
| 48 | + container_volume | ||
| 49 | + </trim> | ||
| 50 | + <trim prefix="VALUES (" suffix=")" suffixOverrides=","> | ||
| 51 | + #{garId}, | ||
| 52 | + #{garOrderId}, | ||
| 53 | + #{garOrderCarType}, | ||
| 54 | + #{garOrderCarUserType}, | ||
| 55 | + #{garCreateTime}, | ||
| 56 | + #{garUpdateTime}, | ||
| 57 | + #{garCreateBy}, | ||
| 58 | + #{garUpdateBy}, | ||
| 59 | + #{garRemark}, | ||
| 60 | + #{carId}, | ||
| 61 | + #{containerVolume} | ||
| 62 | + </trim> | ||
| 63 | + </insert> | ||
| 24 | </mapper> | 64 | </mapper> |
trash-garbage/src/main/resources/mapper/GarOrderMapper.xml
| @@ -275,4 +275,14 @@ | @@ -275,4 +275,14 @@ | ||
| 275 | <select id="queryGarRealCarCountByGarOrderId" resultType="java.lang.Integer"> | 275 | <select id="queryGarRealCarCountByGarOrderId" resultType="java.lang.Integer"> |
| 276 | select gar_real_car_count from gar_order where gar_order_id=#{garOrderId} | 276 | select gar_real_car_count from gar_order where gar_order_id=#{garOrderId} |
| 277 | </select> | 277 | </select> |
| 278 | + | ||
| 279 | + <update id="updateGarRealCarCount"> | ||
| 280 | + update gar_order | ||
| 281 | + set gar_real_car_count = gar_real_car_count + #{garRealCarCount} | ||
| 282 | + where gar_order_id = #{garOrderId} | ||
| 283 | + </update> | ||
| 284 | + | ||
| 285 | + <select id="queryGarNowCarCount"> | ||
| 286 | + SELECT count(*) FROM gar_order_match_ask where gar_order_id = #{garOrderId} and transport_distance is not null | ||
| 287 | + </select> | ||
| 278 | </mapper> | 288 | </mapper> |
trash-garbage/src/main/resources/mapper/GarOrderMatchAskMapper.xml
| @@ -26,6 +26,21 @@ | @@ -26,6 +26,21 @@ | ||
| 26 | gar_create_time,gar_update_time,gar_create_by, | 26 | gar_create_time,gar_update_time,gar_create_by, |
| 27 | gar_update_by,gar_remark | 27 | gar_update_by,gar_remark |
| 28 | </sql> | 28 | </sql> |
| 29 | + <resultMap type="DriverSend" id="driverSendMap"> | ||
| 30 | + <result property="orderId" column="order_id" /> | ||
| 31 | + <result property="phone" column="phone" /> | ||
| 32 | + <result property="state" column="state" /> | ||
| 33 | + </resultMap> | ||
| 34 | + | ||
| 35 | + <insert id="addDriverSend" parameterType="DriverSend"> | ||
| 36 | + insert into driver_send (order_id,phone,state) values (#{orderId},#{phone},#{state}) | ||
| 37 | + </insert> | ||
| 38 | + <select id="queryDriverSend" parameterType="DriverSend" resultMap="driverSendMap"> | ||
| 39 | + select * from driver_send where phone = #{phone} and state = 0 limit 1 | ||
| 40 | + </select> | ||
| 41 | + <update id="updateDriverSendState" parameterType="DriverSend"> | ||
| 42 | + update driver_send set state = 1 where phone = #{phone} | ||
| 43 | + </update> | ||
| 29 | 44 | ||
| 30 | <resultMap type="GarOrderMatchAsk" id="GarOrderMatchAskResult"> | 45 | <resultMap type="GarOrderMatchAsk" id="GarOrderMatchAskResult"> |
| 31 | <result property="garId" column="gar_id" /> | 46 | <result property="garId" column="gar_id" /> |
| @@ -59,7 +74,7 @@ | @@ -59,7 +74,7 @@ | ||
| 59 | <result property="updateTime" column="update_time" /> | 74 | <result property="updateTime" column="update_time" /> |
| 60 | <result property="garOrderTime" column="gar_order_time" /> | 75 | <result property="garOrderTime" column="gar_order_time" /> |
| 61 | <result property="transportDistance" column="transport_distance" /> | 76 | <result property="transportDistance" column="transport_distance" /> |
| 62 | - | 77 | + <result property="unloadingLonLat" column="unloading_lon_lat" /> |
| 63 | </resultMap> | 78 | </resultMap> |
| 64 | 79 | ||
| 65 | <sql id="selectGarOrderMatchAskVo"> | 80 | <sql id="selectGarOrderMatchAskVo"> |
| @@ -198,4 +213,63 @@ | @@ -198,4 +213,63 @@ | ||
| 198 | select COUNT(*) from gar_order_match_ask where gar_order_id = #{orderId} and transport_distance is not null | 213 | select COUNT(*) from gar_order_match_ask where gar_order_id = #{orderId} and transport_distance is not null |
| 199 | </select> | 214 | </select> |
| 200 | 215 | ||
| 216 | + <select id="queryErrType" resultType="java.lang.Integer"> | ||
| 217 | + select count(*) from gar_order_match_ask where gar_order_handler_tel = #{phone} and gar_order_type = 1 | ||
| 218 | + </select> | ||
| 219 | + | ||
| 220 | + <select id="queryCarCode" parameterType="string" resultMap="GarOrderMatchAskResult"> | ||
| 221 | + SELECT gar_order_handler_name,gar_handler_car_code | ||
| 222 | + FROM gar_order_match_ask | ||
| 223 | + WHERE gar_order_id = #{garOrderId} | ||
| 224 | + group by gar_handler_car_code | ||
| 225 | + </select> | ||
| 226 | + | ||
| 227 | + <select id="queryGarOrderMatchAsks" resultType="java.lang.Integer"> | ||
| 228 | + select COUNT(*) from gar_order_match_ask where gar_order_id = #{orderId} and (transport_distance is null or transport_distance = '') | ||
| 229 | + </select> | ||
| 230 | + | ||
| 231 | + <select id="selectByGarOrderAskId" parameterType="string" resultMap="GarOrderMatchAskResult"> | ||
| 232 | + SELECT gar_id,gar_order_id,gar_create_by,gar_update_by,drop_point_id,drop_point_name,gar_order_type,disposal_id,disposal_site_name,gar_order_number,gar_order_phone,gar_order_name,drop_address,drop_car_num,gar_order_time | ||
| 233 | + FROM gar_order_match_ask | ||
| 234 | + WHERE gar_order_id = #{garOrderId} | ||
| 235 | + ORDER BY gar_order_number DESC | ||
| 236 | + LIMIT 1 | ||
| 237 | + </select> | ||
| 238 | + | ||
| 239 | + <insert id="insertGarOrderMatchAskBySelect" parameterType="com.trash.garbage.pojo.domain.GarOrderMatchAsk"> | ||
| 240 | + INSERT INTO gar_order_match_ask ( | ||
| 241 | + gar_id, | ||
| 242 | + gar_order_id, | ||
| 243 | + gar_create_by, | ||
| 244 | + gar_update_by, | ||
| 245 | + drop_point_id, | ||
| 246 | + drop_point_name, | ||
| 247 | + gar_order_type, | ||
| 248 | + disposal_id, | ||
| 249 | + disposal_site_name, | ||
| 250 | + gar_order_number, | ||
| 251 | + gar_order_phone, | ||
| 252 | + gar_order_name, | ||
| 253 | + drop_address, | ||
| 254 | + drop_car_num, | ||
| 255 | + gar_order_time | ||
| 256 | + ) VALUES ( | ||
| 257 | + #{garId}, | ||
| 258 | + #{garOrderId}, | ||
| 259 | + #{garCreateBy}, | ||
| 260 | + #{garUpdateBy}, | ||
| 261 | + #{dropPointId}, | ||
| 262 | + #{dropPointName}, | ||
| 263 | + #{garOrderType}, | ||
| 264 | + #{disposalId}, | ||
| 265 | + #{disposalSiteName}, | ||
| 266 | + #{garOrderNumber}, | ||
| 267 | + #{garOrderPhone}, | ||
| 268 | + #{garOrderName}, | ||
| 269 | + #{dropAddress}, | ||
| 270 | + #{dropCarNum}, | ||
| 271 | + #{garOrderTime} | ||
| 272 | + ) | ||
| 273 | + </insert> | ||
| 274 | + | ||
| 201 | </mapper> | 275 | </mapper> |
trash-garbage/src/main/resources/mapper/GarOrderMatchHandlerMapper.xml
| @@ -68,4 +68,5 @@ | @@ -68,4 +68,5 @@ | ||
| 68 | <select id="queryGarOrderMatchHandler" resultType="com.trash.garbage.pojo.domain.GarOrderMatchHandler"> | 68 | <select id="queryGarOrderMatchHandler" resultType="com.trash.garbage.pojo.domain.GarOrderMatchHandler"> |
| 69 | select * from gar_order_match_handler where gar_order_id = #{orderId} | 69 | select * from gar_order_match_handler where gar_order_id = #{orderId} |
| 70 | </select> | 70 | </select> |
| 71 | + | ||
| 71 | </mapper> | 72 | </mapper> |