Commit a0cc8a1eef342b050e2c506db8b8e1a60698926c

Authored by fengliang
1 parent f1721899

update:地址列表筛选是否可配送

Showing 18 changed files with 223 additions and 43 deletions
etrade-order/src/main/java/com/diligrp/etrade/order/api/OrderContactPersonController.java
... ... @@ -92,5 +92,17 @@ public class OrderContactPersonController {
92 92 List<BaseRegionNextVo> baseRegionNextVoList = baseRegionService.getNextList(co);
93 93 return Message.success(baseRegionNextVoList);
94 94 }
  95 +
  96 +
  97 + /**
  98 + * 查询地址是否可配送
  99 + * @param co
  100 + * @return
  101 + */
  102 + @PostMapping(value = "/checkRegion")
  103 + public Message<Boolean> checkRegion(@RequestBody BaseRegionCo co) {
  104 + baseRegionService.checkRegion(co.getProvinceId(),co.getCityId(),co.getDistrictId(),co.getStreetId(),co.getMarketId());
  105 + return Message.success(true);
  106 + }
95 107 }
96 108  
... ...
etrade-order/src/main/java/com/diligrp/etrade/order/api/OrderDeliveryController.java
... ... @@ -2,6 +2,7 @@ package com.diligrp.etrade.order.api;
2 2  
3 3 import com.diligrp.etrade.core.domain.Message;
4 4 import com.diligrp.etrade.order.domain.OrderOperateDto;
  5 +import com.diligrp.etrade.order.service.BaseRegionService;
5 6 import com.diligrp.etrade.order.service.OrderDeliveryService;
6 7 import com.diligrp.etrade.order.type.OrderOrderType;
7 8 import com.diligrp.etrade.order.util.OrderConstant;
... ... @@ -34,6 +35,7 @@ public class OrderDeliveryController {
34 35 @Resource
35 36 private RedissonClient redissonClient;
36 37  
  38 +
37 39 /**
38 40 * 选择配送方式
39 41 * @param orderOperateDto 操作标识
... ...
etrade-order/src/main/java/com/diligrp/etrade/order/dao/BaseRegionMapper.java
... ... @@ -4,6 +4,7 @@ package com.diligrp.etrade.order.dao;
4 4 import com.diligrp.etrade.core.mybatis.MybatisMapperSupport;
5 5 import com.diligrp.etrade.order.domain.contactPerson.BaseRegionCo;
6 6 import com.diligrp.etrade.order.model.BaseRegion;
  7 +import org.apache.ibatis.annotations.Param;
7 8  
8 9 import java.util.List;
9 10  
... ... @@ -18,4 +19,6 @@ import java.util.List;
18 19 public interface BaseRegionMapper extends MybatisMapperSupport {
19 20  
20 21 List<BaseRegion> selectNextList(BaseRegionCo co);
  22 +
  23 + BaseRegion getRegionsByIds(@Param("provinceId") Long provinceId,@Param("cityId") Long cityId,@Param("districtId") Long districtId,@Param("streetId") Long streetId,@Param("marketId") Long marketId);
21 24 }
... ...
etrade-order/src/main/java/com/diligrp/etrade/order/domain/OrderDeliveryDto.java
... ... @@ -36,13 +36,16 @@ public class OrderDeliveryDto {
36 36 private Integer wayType;
37 37  
38 38 /** 省份 */
  39 + @NotNull(message = "省份不能为空")
39 40 private Long provinceId;
40 41  
41 42 /** 省份名称 */
  43 +
42 44 @NotNull(message = "省份不能为空")
43 45 private String provinceName;
44 46  
45 47 /** 城市 */
  48 + @NotNull(message = "城市不能为空")
46 49 private Long cityId;
47 50  
48 51 /** 城市 */
... ... @@ -50,12 +53,26 @@ public class OrderDeliveryDto {
50 53 private String cityName;
51 54  
52 55 /** 区县 */
  56 + @NotNull(message = "区县不能为空")
53 57 private Long districtId;
54 58  
55 59 /** 区县 */
56 60 @NotNull(message = "区县不能为空")
57 61 private String districtName;
58 62  
  63 + /**
  64 + * 街道
  65 + */
  66 + @NotNull(message = "街道不能为空")
  67 + private Long streetId;
  68 +
  69 + /**
  70 + * 街道名称
  71 + */
  72 + @NotNull(message = "街道名称不能为空")
  73 + private String streetName;
  74 +
  75 +
59 76 /** 收货人电话 */
60 77 @NotNull(message = "电话号码不能为空")
61 78 @Length(max = 11,message = "电话号码不能超过11位")
... ... @@ -229,4 +246,20 @@ public class OrderDeliveryDto {
229 246 public void setModifierId(Long modifierId) {
230 247 this.modifierId = modifierId;
231 248 }
  249 +
  250 + public Long getStreetId() {
  251 + return streetId;
  252 + }
  253 +
  254 + public void setStreetId(Long streetId) {
  255 + this.streetId = streetId;
  256 + }
  257 +
  258 + public String getStreetName() {
  259 + return streetName;
  260 + }
  261 +
  262 + public void setStreetName(String streetName) {
  263 + this.streetName = streetName;
  264 + }
232 265 }
... ...
etrade-order/src/main/java/com/diligrp/etrade/order/domain/contactPerson/OrderContactPersonCo.java
... ... @@ -51,32 +51,47 @@ public class OrderContactPersonCo extends BaseDo {
51 51 /**
52 52 * 省份
53 53 */
  54 + @NotNull(message = "省份不能为空")
54 55 private Long provinceId;
55 56 /**
56   - * 省份
  57 + * 省份名称
57 58 */
58   - @NotNull(message = "省份不能为空")
  59 + @NotNull(message = "省份名称不能为空")
59 60 private String provinceName;
60 61 /**
61 62 * 城市
62 63 */
  64 + @NotNull(message = "城市不能为空")
63 65 private Long cityId;
64 66 /**
65   - * 城市
  67 + * 城市名称
66 68 */
67   - @NotNull(message = "城市不能为空")
  69 + @NotNull(message = "城市名称不能为空")
68 70 private String cityName;
69 71 /**
70 72 * 区县
71 73 */
  74 + @NotNull(message = "区县不能为空")
72 75 private Long districtId;
73 76 /**
74   - * 区县
  77 + * 区县名称
75 78 */
76   - @NotNull(message = "区县不能为空")
  79 + @NotNull(message = "区县名称不能为空")
77 80 private String districtName;
78 81  
79 82 /**
  83 + * 街道
  84 + */
  85 + @NotNull(message = "街道不能为空")
  86 + private Long streetId;
  87 +
  88 + /**
  89 + * 街道名称
  90 + */
  91 + @NotNull(message = "街道名称不能为空")
  92 + private String streetName;
  93 +
  94 + /**
80 95 * 状态 1:启用 2:禁用
81 96 * @return
82 97 */
... ...
etrade-order/src/main/java/com/diligrp/etrade/order/domain/contactPerson/OrderContactPersonListCo.java
... ... @@ -18,6 +18,11 @@ public class OrderContactPersonListCo extends BasePageQuery {
18 18 private Long createrId;
19 19  
20 20 /**
  21 + * 市场id
  22 + */
  23 + private Long marketId;
  24 +
  25 + /**
21 26 * 姓名
22 27 */
23 28 private String name;
... ... @@ -65,4 +70,12 @@ public class OrderContactPersonListCo extends BasePageQuery {
65 70 public void setMobile(String mobile) {
66 71 this.mobile = mobile;
67 72 }
  73 +
  74 + public Long getMarketId() {
  75 + return marketId;
  76 + }
  77 +
  78 + public void setMarketId(Long marketId) {
  79 + this.marketId = marketId;
  80 + }
68 81 }
69 82 \ No newline at end of file
... ...
etrade-order/src/main/java/com/diligrp/etrade/order/domain/contactPerson/OrderContactPersonListVo.java
... ... @@ -79,6 +79,11 @@ public class OrderContactPersonListVo implements Serializable {
79 79  
80 80 private Integer defaultType;
81 81  
  82 + /**
  83 + * 是否可配送 0 不可配送,1可配送
  84 + */
  85 + private Integer deliverable;
  86 +
82 87 public Integer getDefaultType() {
83 88 return defaultType;
84 89 }
... ... @@ -209,4 +214,12 @@ public class OrderContactPersonListVo implements Serializable {
209 214 public void setVersion(Integer version) {
210 215 this.version = version;
211 216 }
  217 +
  218 + public Integer getDeliverable() {
  219 + return deliverable;
  220 + }
  221 +
  222 + public void setDeliverable(Integer deliverable) {
  223 + this.deliverable = deliverable;
  224 + }
212 225 }
213 226 \ No newline at end of file
... ...
etrade-order/src/main/java/com/diligrp/etrade/order/model/OrderContactPerson.java
... ... @@ -62,6 +62,15 @@ public class OrderContactPerson extends BaseDo {
62 62 * 区县
63 63 */
64 64 private String districtName;
  65 + /**
  66 + * 街道
  67 + */
  68 + private Long streetId;
  69 +
  70 + /**
  71 + * 街道名称
  72 + */
  73 + private String streetName;
65 74  
66 75 /**
67 76 * 状态 1:启用 2:禁用
... ... @@ -186,6 +195,22 @@ public class OrderContactPerson extends BaseDo {
186 195 this.state = state;
187 196 }
188 197  
  198 + public Long getStreetId() {
  199 + return streetId;
  200 + }
  201 +
  202 + public void setStreetId(Long streetId) {
  203 + this.streetId = streetId;
  204 + }
  205 +
  206 + public String getStreetName() {
  207 + return streetName;
  208 + }
  209 +
  210 + public void setStreetName(String streetName) {
  211 + this.streetName = streetName;
  212 + }
  213 +
189 214 @Override
190 215 public String toString() {
191 216 return "EcapContactPersonDo{" +
... ... @@ -201,6 +226,8 @@ public class OrderContactPerson extends BaseDo {
201 226 ", cityName='" + cityName + '\'' +
202 227 ", districtId=" + districtId +
203 228 ", districtName='" + districtName + '\'' +
  229 + ", streetId=" + streetId +
  230 + ", streetName='" + streetName + '\'' +
204 231 ", state=" + state +
205 232 ", id=" + id +
206 233 ", version=" + version +
... ...
etrade-order/src/main/java/com/diligrp/etrade/order/model/OrderDelivery.java
... ... @@ -43,6 +43,15 @@ public class OrderDelivery {
43 43  
44 44 /** 区县 */
45 45 private String districtName;
  46 + /**
  47 + * 街道
  48 + */
  49 + private Long streetId;
  50 +
  51 + /**
  52 + * 街道名称
  53 + */
  54 + private String streetName;
46 55  
47 56 /** 收货人电话 */
48 57 private String receiverPhone;
... ...
etrade-order/src/main/java/com/diligrp/etrade/order/service/BaseRegionService.java
... ... @@ -14,4 +14,13 @@ import java.util.List;
14 14 */
15 15 public interface BaseRegionService {
16 16 List<BaseRegionNextVo> getNextList(BaseRegionCo co);
  17 +
  18 + /**
  19 + * 校验是否可配送
  20 + * @param provinceId
  21 + * @param cityId
  22 + * @param districtId
  23 + * @param streetId
  24 + */
  25 + void checkRegion(Long provinceId, Long cityId, Long districtId, Long streetId,Long marketId);
17 26 }
... ...
etrade-order/src/main/java/com/diligrp/etrade/order/service/OrderContactPersonService.java
... ... @@ -3,6 +3,7 @@ package com.diligrp.etrade.order.service;
3 3  
4 4 import com.diligrp.etrade.core.domain.Message;
5 5 import com.diligrp.etrade.core.domain.PageMessage;
  6 +import com.diligrp.etrade.order.domain.OrderCreateDto;
6 7 import com.diligrp.etrade.order.domain.contactPerson.OrderContactPersonCo;
7 8 import com.diligrp.etrade.order.domain.contactPerson.OrderContactPersonListCo;
8 9 import com.diligrp.etrade.order.domain.contactPerson.OrderContactPersonListVo;
... ...
etrade-order/src/main/java/com/diligrp/etrade/order/service/OrderDeliveryService.java
1 1 package com.diligrp.etrade.order.service;
2 2  
  3 +import com.diligrp.etrade.order.domain.OrderCreateDto;
3 4 import com.diligrp.etrade.order.domain.OrderOperateDto;
4 5 import com.diligrp.etrade.order.model.Order;
5 6 import com.diligrp.etrade.order.model.OrderDelivery;
... ... @@ -26,4 +27,10 @@ public interface OrderDeliveryService {
26 27  
27 28 /** 订单配送超时自动收货 */
28 29 void endOrderDeliveryOutTime();
  30 +
  31 + /**
  32 + * 校验配送地址
  33 + * @param orderCreateDto
  34 + */
  35 + void checkPersonContact(OrderCreateDto orderCreateDto);
29 36 }
... ...
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/BaseRegionServiceImpl.java
... ... @@ -76,23 +76,8 @@ public class BaseRegionServiceImpl implements BaseRegionService {
76 76 citiesMap = new HashMap<>();
77 77 provinces.add(baseProvince);
78 78 }
79   -// BaseRegionNextVo city = new BaseRegionNextVo(baseRegion.getCityId(), baseRegion.getCityName(),2);
80   -// citiesMap.put(baseRegion.getCityId(),city);
81   - }/*else{
82   - if(citiesMap.get(baseRegion.getCityId())==null){
83   - BaseRegionNextVo city = new BaseRegionNextVo(baseRegion.getCityId(), baseRegion.getCityName(),2);
84   - citiesMap.put(baseRegion.getCityId(),city);
85   - }
86   - }*/
87   -// BaseRegionNextVo district = new BaseRegionNextVo(baseRegion.getDistrictId(), baseRegion.getDistrictName(),3);
88   -// districtsMap.put(district.getId(),district);
89   - }/*else{
90   - if(districtsMap.get(baseRegion.getDistrictId())==null){
91   - BaseRegionNextVo district = new BaseRegionNextVo(baseRegion.getDistrictId(), baseRegion.getDistrictName(),3);
92   - districtsMap.put(baseRegion.getDistrictId(),district);
93 79 }
94   -
95   - }*/
  80 + }
96 81 BaseRegionNextVo street = new BaseRegionNextVo(baseRegion.getStreetId(), baseRegion.getStreetName(),4);
97 82 streetList.add(street);
98 83 lastBaseRegion = baseRegion;
... ... @@ -122,4 +107,12 @@ public class BaseRegionServiceImpl implements BaseRegionService {
122 107  
123 108 return provinces;
124 109 }
  110 +
  111 + @Override
  112 + public void checkRegion(Long provinceId, Long cityId, Long districtId, Long streetId,Long marketId) {
  113 + BaseRegion baseRegions = baseRegionMapper.getRegionsByIds(provinceId,cityId,districtId,streetId,marketId);
  114 + if(baseRegions == null){
  115 + throw new OrderException(OrderErrorCode.PARAM_ERROR,"暂不支持该地址配送");
  116 + }
  117 + }
125 118 }
... ...
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/OrderContactPersonServiceImpl.java
... ... @@ -4,11 +4,14 @@ import com.diligrp.etrade.core.domain.Message;
4 4 import com.diligrp.etrade.core.domain.PageMessage;
5 5 import com.diligrp.etrade.core.util.JsonUtils;
6 6 import com.diligrp.etrade.order.dao.OrderContactPersonMapper;
  7 +import com.diligrp.etrade.order.domain.OrderCreateDto;
7 8 import com.diligrp.etrade.order.domain.contactPerson.OrderContactPersonCo;
8 9 import com.diligrp.etrade.order.domain.contactPerson.OrderContactPersonListCo;
9 10 import com.diligrp.etrade.order.domain.contactPerson.OrderContactPersonListVo;
10 11 import com.diligrp.etrade.order.model.OrderContactPerson;
11 12 import com.diligrp.etrade.order.service.OrderContactPersonService;
  13 +import com.diligrp.etrade.order.type.OrderAchieveState;
  14 +import com.diligrp.etrade.order.type.OrderAchieveType;
12 15 import com.diligrp.etrade.order.type.OrderContactDefaultType;
13 16 import com.github.pagehelper.Page;
14 17 import com.github.pagehelper.PageHelper;
... ...
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/OrderDeliveryServiceImpl.java
... ... @@ -3,6 +3,7 @@ package com.diligrp.etrade.order.service.impl;
3 3 import com.diligrp.etrade.order.dao.OrderDeliveryMapper;
4 4 import com.diligrp.etrade.order.dao.OrderExtraMapper;
5 5 import com.diligrp.etrade.order.dao.OrderMapper;
  6 +import com.diligrp.etrade.order.domain.OrderCreateDto;
6 7 import com.diligrp.etrade.order.domain.OrderDeliveryCheckDto;
7 8 import com.diligrp.etrade.order.domain.OrderGetDto;
8 9 import com.diligrp.etrade.order.domain.OrderOperateDto;
... ... @@ -11,11 +12,9 @@ import com.diligrp.etrade.order.exception.OrderException;
11 12 import com.diligrp.etrade.order.model.Order;
12 13 import com.diligrp.etrade.order.model.OrderDelivery;
13 14 import com.diligrp.etrade.order.model.OrderExtra;
14   -import com.diligrp.etrade.order.service.OrderDeliveryService;
15   -import com.diligrp.etrade.order.service.OrderExtraService;
16   -import com.diligrp.etrade.order.service.OrderPaymentService;
17   -import com.diligrp.etrade.order.service.OrderService;
  15 +import com.diligrp.etrade.order.service.*;
18 16 import com.diligrp.etrade.order.type.OrderAchieveState;
  17 +import com.diligrp.etrade.order.type.OrderAchieveType;
19 18 import com.diligrp.etrade.order.type.OrderOrderState;
20 19 import com.diligrp.etrade.order.type.OrderState;
21 20 import com.diligrp.etrade.order.util.OrderConstant;
... ... @@ -58,6 +57,9 @@ public class OrderDeliveryServiceImpl implements OrderDeliveryService {
58 57 @Resource
59 58 private RedissonClient redissonClient;
60 59  
  60 + @Resource
  61 + private BaseRegionService baseRegionService;
  62 +
61 63 @Override
62 64 public int createOrderDelivery(OrderDelivery orderDelivery) {
63 65 return orderDeliveryMapper.save(orderDelivery);
... ... @@ -239,4 +241,13 @@ public class OrderDeliveryServiceImpl implements OrderDeliveryService {
239 241  
240 242  
241 243 }
  244 + @Override
  245 + public void checkPersonContact(OrderCreateDto orderCreateDto) {
  246 + if(orderCreateDto==null||orderCreateDto.getDelivery()==null){
  247 + return;
  248 + }
  249 + if(OrderAchieveType.SELLER_DELIVERY.getCodeInteger().equals(orderCreateDto.getAchieveType())){
  250 + baseRegionService.checkRegion(orderCreateDto.getDelivery().getProvinceId(),orderCreateDto.getDelivery().getCityId(),orderCreateDto.getDelivery().getDistrictId(),orderCreateDto.getDelivery().getStreetId(),orderCreateDto.getMarketId());
  251 + }
  252 + }
242 253 }
... ...
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/OrderServiceImpl.java
... ... @@ -85,9 +85,6 @@ public class OrderServiceImpl implements OrderService {
85 85 private OrderPaymentService orderPaymentService;
86 86  
87 87 @Resource
88   - private OrderPaymentFeeService orderPaymentFeeService;
89   -
90   - @Resource
91 88 private OrderCouponService orderCouponService;
92 89  
93 90 @Resource
... ... @@ -107,8 +104,6 @@ public class OrderServiceImpl implements OrderService {
107 104  
108 105 @Resource
109 106 private PayRpcResolver payRpcResolver;
110   - @Resource
111   - private WeChatPayRpcResolver weChatPayRpcResolver;
112 107  
113 108 @Resource
114 109 private SettingShopCommonService settingShopCommonService;
... ... @@ -116,15 +111,9 @@ public class OrderServiceImpl implements OrderService {
116 111 private OrderExtraService orderExtraService;
117 112  
118 113 @Resource
119   - private ShopService shopService;
120   -
121   - @Resource
122 114 private OrderDeliveryService orderDeliveryService;
123 115  
124 116 @Resource
125   - private BasicDataConfigRpc basicDataConfigRpc;
126   -
127   - @Resource
128 117 private IShopCartMessageService shopCartMessageService;
129 118  
130 119 @Resource
... ... @@ -144,6 +133,8 @@ public class OrderServiceImpl implements OrderService {
144 133 orderCreateDto.setShopCustomerId(shop.getCustomerId());
145 134 orderCreateDto.setShopName(shop.getName());
146 135 orderCreateDto.setShopCustomerName(shop.getCustomerName());
  136 + //效验买方地址是否可配送
  137 + orderDeliveryService.checkPersonContact(orderCreateDto);
147 138 //验证订单商品总重量与订单商品总价格
148 139 orderGoodsService.checkBuyerOrderDto(orderCreateDto,orderType,transportFeeFlag);
149 140 //创建订单
... ... @@ -188,6 +179,8 @@ public class OrderServiceImpl implements OrderService {
188 179 orderCreateDto.setShopCustomerId(shop.getCustomerId());
189 180 orderCreateDto.setShopName(shop.getName());
190 181 orderCreateDto.setShopCustomerName(shop.getCustomerName());
  182 + //效验买方地址是否可配送
  183 + orderDeliveryService.checkPersonContact(orderCreateDto);
191 184 //验证订单商品总重量与订单商品总价格
192 185 orderGoodsService.checkBuyerOrderDto(orderCreateDto,identityType,true);
193 186 //创建订单
... ... @@ -423,6 +416,8 @@ public class OrderServiceImpl implements OrderService {
423 416 @Transactional
424 417 @Override
425 418 public void updateOrder(OrderCreateDto buyerOrderDto, Integer orderType) {
  419 + //效验买方地址是否可配送
  420 + orderDeliveryService.checkPersonContact(buyerOrderDto);
426 421 //验证订单商品总重量与订单商品总价格
427 422 orderGoodsService.checkBuyerOrderDto(buyerOrderDto,orderType,true);
428 423 //获取原始订单
... ... @@ -455,6 +450,8 @@ public class OrderServiceImpl implements OrderService {
455 450 public void updateSellerOrder(OrderCreateDto buyerOrderDto, Integer orderType) {
456 451 //获取订单并效验状态
457 452 Order order = getOrderAndCheckState(null, buyerOrderDto.getCode(), buyerOrderDto.getMarketId(),OrderOrderState.SELLER_FIX,buyerOrderDto);
  453 + //效验买方地址是否可配送
  454 + orderDeliveryService.checkPersonContact(buyerOrderDto);
458 455 //验证订单商品总重量与订单商品总价格
459 456 orderGoodsService.checkBuyerOrderDto(buyerOrderDto,orderType,true);
460 457 //判断卖方修改人是否有权限修改订单
... ...
etrade-order/src/main/resources/com/diligrp/etrade/dao/mapper/contactPerson/OrderContactPersonMapper.xml
... ... @@ -17,6 +17,8 @@
17 17 <result column="city_name" jdbcType="VARCHAR" property="cityName" />
18 18 <result column="district_id" jdbcType="BIGINT" property="districtId" />
19 19 <result column="district_name" jdbcType="VARCHAR" property="districtName" />
  20 + <result column="street_id" jdbcType="BIGINT" property="streetId" />
  21 + <result column="street_name" jdbcType="VARCHAR" property="streetName" />
20 22 <result column="address" jdbcType="VARCHAR" property="address" />
21 23 <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
22 24 <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
... ... @@ -25,10 +27,7 @@
25 27 <result column="default_type" jdbcType="INTEGER" property="defaultType" />
26 28 </resultMap>
27 29 <sql id="Base_Column_List">
28   - <!--
29   - WARNING - @mbg.generated
30   - -->
31   - id,creater_id,creater, name, mobile,extension_number,province_id,province_name,city_id,city_name, district_id,district_name, address, created_time, modified_time,state,version,default_type
  30 + id,creater_id,creater, `name`, mobile,extension_number,province_id,province_name,city_id,city_name, district_id,district_name, street_id,street_name, address, created_time, modified_time,state,version,default_type
32 31 </sql>
33 32 <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true" parameterType="com.diligrp.etrade.order.model.OrderContactPerson">
34 33 INSERT INTO ecap_contact_person(
... ... @@ -43,6 +42,8 @@
43 42 city_name,
44 43 district_id,
45 44 district_name,
  45 + street_id,
  46 + street_name,
46 47 address,
47 48 version,
48 49 state,
... ... @@ -57,6 +58,8 @@
57 58 #{provinceName},
58 59 #{cityId},
59 60 #{cityName},
  61 + #{streetId},
  62 + #{streetName},
60 63 #{districtId},
61 64 #{districtName},
62 65 #{address},
... ... @@ -70,6 +73,7 @@
70 73 name = #{name},mobile = #{mobile},extension_number = #{extensionNumber},
71 74 province_id = #{provinceId},city_id = #{cityId},
72 75 district_id = #{districtId},province_name = #{provinceName},
  76 + street_id = #{streetId},street_name = #{streetName},
73 77 city_name = #{cityName},district_name = #{districtName},
74 78 address = #{address},version = #{version}+1,
75 79 state = #{state},default_type = #{defaultType}
... ... @@ -87,8 +91,13 @@
87 91  
88 92 <select id="list" resultType="com.diligrp.etrade.order.domain.contactPerson.OrderContactPersonListVo">
89 93 SELECT
90   - <include refid="Base_Column_List" />
  94 + p.id id,p.creater_id creater_id,p.creater creater, p.`name` name, p.mobile mobile,p.extension_number extension_number,p.province_id province_id,
  95 + p.province_name province_name,p.city_id city_id,p.city_name city_name, p.district_id district_id,p.district_name district_name, p.street_id street_id,
  96 + p.street_name street_name, p.address address, p.created_time created_time, p.modified_time modified_time,p.state state,p.version version,
  97 + p.default_type default_type,
  98 + case when br.state is not null then br.state else 0 end as deliverable
91 99 FROM ecap_contact_person p
  100 + left join base_region br on p.street_id = br.street_id and br.market_id = #{marketId}
92 101 WHERE p.state = 1
93 102 AND p.creater_id = #{createrId}
94 103 <if test="keyWords !=null and keyWords !=''">
... ...
etrade-order/src/main/resources/com/diligrp/etrade/dao/mapper/order/BaseRegionMapper.xml
... ... @@ -25,7 +25,8 @@
25 25 select
26 26 <include refid="Base_Column_List" />
27 27 from base_region
28   - <where> 1=1
  28 + <where>
  29 + market_id = #{marketId,jdbcType=BIGINT}
29 30 <if test="provinceId != null">
30 31 and province_id = #{provinceId,jdbcType=BIGINT}
31 32 </if>
... ... @@ -42,4 +43,26 @@
42 43 </where>
43 44 order by province_id,city_id,district_id,street_id
44 45 </select>
  46 + <select id="getRegionsByIds" resultType="com.diligrp.etrade.order.model.BaseRegion">
  47 + select
  48 + <include refid="Base_Column_List" />
  49 + from base_region
  50 + <where>
  51 + market_id = #{marketId,jdbcType=BIGINT}
  52 + <if test="provinceId != null">
  53 + and province_id = #{provinceId,jdbcType=BIGINT}
  54 + </if>
  55 + <if test="cityId != null">
  56 + and city_id = #{cityId,jdbcType=BIGINT}
  57 + </if>
  58 + <if test="districtId != null">
  59 + and district_id= #{districtId,jdbcType=BIGINT}
  60 + </if>
  61 + <if test="streetId != null">
  62 + and street_id= #{streetId,jdbcType=BIGINT}
  63 + </if>
  64 + and state = 1
  65 + </where>
  66 + limit 1
  67 + </select>
45 68 </mapper>
46 69 \ No newline at end of file
... ...