mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 占桩订单逻辑
This commit is contained in:
@@ -131,8 +131,8 @@ public class GroundLockDataUploadHandler extends AbstractHandler{
|
||||
* 降锁成功的时候调用
|
||||
*/
|
||||
private void lowerTheGroundLock(String pileSn, String connectorCode) {
|
||||
// 查出占桩订单 草稿单 ,将开始时间set进订单信息
|
||||
OrderPileOccupy orderInfo = orderPileOccupyService.getOrderInfoByPile(pileSn, connectorCode);
|
||||
// 查出草稿单占桩订单,将开始时间set进订单信息
|
||||
OrderPileOccupy orderInfo = orderPileOccupyService.getDraftOccupyOrder(pileSn, connectorCode);
|
||||
if (orderInfo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -99,4 +99,6 @@ public interface OrderPileOccupyMapper {
|
||||
* @return
|
||||
*/
|
||||
OrderPileOccupy getOrderInfoByPile(@Param("pileSn") String pileSn, @Param("connectorCode") String connectorCode);
|
||||
|
||||
List<OrderPileOccupy> getDraftOccupyOrder(@Param("pileSn") String pileSn, @Param("connectorCode") String connectorCode);
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public interface OrderPileOccupyService{
|
||||
* @param connectorCode
|
||||
* @return
|
||||
*/
|
||||
OrderPileOccupy getOrderInfoByPile(String pileSn, String connectorCode);
|
||||
OrderPileOccupy getDraftOccupyOrder(String pileSn, String connectorCode);
|
||||
|
||||
/**
|
||||
* 控制地锁方法
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.jsowell.pile.vo.web.BillingTemplateVO;
|
||||
import com.jsowell.pile.vo.web.OrderListVO;
|
||||
import com.jsowell.pile.vo.web.UpdateMemberBalanceDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -34,6 +35,7 @@ import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@@ -312,13 +314,22 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService {
|
||||
|
||||
/**
|
||||
* 根据桩编号、枪口号查询最近一条占桩订单
|
||||
* draft
|
||||
* @param pileSn
|
||||
* @param connectorCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public OrderPileOccupy getOrderInfoByPile(String pileSn, String connectorCode) {
|
||||
return orderPileOccupyMapper.getOrderInfoByPile(pileSn, connectorCode);
|
||||
public OrderPileOccupy getDraftOccupyOrder(String pileSn, String connectorCode) {
|
||||
List<OrderPileOccupy> list = orderPileOccupyMapper.getDraftOccupyOrder(pileSn, connectorCode);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return null;
|
||||
}
|
||||
if (list.size() > 1) {
|
||||
List<Integer> collect = list.stream().map(OrderPileOccupy::getId).collect(Collectors.toList());
|
||||
log.info("根据pileSn:{}, connectorCode:{}, 查询出多条占桩订单, ids:{}", pileSn, connectorCode, collect);
|
||||
}
|
||||
return list.get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -868,4 +868,16 @@
|
||||
create_time DESC
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="getDraftOccupyOrder" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from
|
||||
order_pile_occupy
|
||||
where del_flag = '0'
|
||||
and status = '9'
|
||||
and pile_sn = #{pileSn,jdbcType=VARCHAR}
|
||||
and connector_code = #{connectorCode,jdbcType=VARCHAR}
|
||||
order by create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user