|
@@ -376,14 +376,13 @@ public class DeliveryAction implements IMINAction{
|
|
|
|
|
|
for (int i = 0; i < drawDtoList.size(); i++) {
|
|
|
DrawDto drawDto = drawDtoList.get(i);
|
|
|
- if(drawDto.isDraw()){ //中奖的
|
|
|
+
|
|
|
String orderId = drawDto.getOrderId();
|
|
|
String orderDetailsId = drawDto.getOrderDetailsId();
|
|
|
//获取订单信息
|
|
|
VmOrderInf ordInf = Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmOrderInfMapper.class)
|
|
|
.selectByPrimaryKey(orderId);
|
|
|
-
|
|
|
if(ordInf == null){
|
|
|
throw new BusinessCodeException("JINM0114");//订单信息不存在
|
|
|
}else{
|
|
@@ -396,6 +395,8 @@ public class DeliveryAction implements IMINAction{
|
|
|
.getMybatisMapper(VmOrderDetailsMapper.class)
|
|
|
.selectByPrimaryKey(orderDetailsId);
|
|
|
|
|
|
+ //中奖的
|
|
|
+ if(drawDto.isDraw()){
|
|
|
//创建提货对象
|
|
|
VmDeliveryInf dlInf = new VmDeliveryInf();
|
|
|
//获取提货表主键
|
|
@@ -424,17 +425,29 @@ public class DeliveryAction implements IMINAction{
|
|
|
Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmDeliveryInfMapper.class)
|
|
|
.insertSelective(dlInf);
|
|
|
+
|
|
|
//更新订单详情
|
|
|
- if(ordInf.getIsDraw().equals("00")){
|
|
|
- detInf.setDeliveryId(dlId);
|
|
|
- ordInf.setIsDraw("01");
|
|
|
+ detInf.setDeliveryId(dlId);
|
|
|
+ ordInf.setIsDraw("01");
|
|
|
+ detInf.setIsWinning("01");
|
|
|
+ Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmOrderDetailsMapper.class)
|
|
|
+ .updateByPrimaryKeySelective(detInf);
|
|
|
+ if(!ordInf.equals("01") && !ordInf.equals("02")){
|
|
|
Service.lookup(IMINDataBaseService.class)
|
|
|
- .getMybatisMapper(VmOrderDetailsMapper.class)
|
|
|
- .updateByPrimaryKeySelective(detInf);
|
|
|
+ .getMybatisMapper(VmOrderInfMapper.class)
|
|
|
+ .updateByPrimaryKeySelective(ordInf);
|
|
|
}
|
|
|
-
|
|
|
+ /**没有中奖的*/
|
|
|
+ }else{
|
|
|
+ ordInf.setIsDraw("00");
|
|
|
+ detInf.setIsWinning("02");
|
|
|
+ Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmOrderDetailsMapper.class)
|
|
|
+ .updateByPrimaryKeySelective(detInf);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|