Commit b6d9ccd4 authored by 周健威's avatar 周健威

修改保险

parent a0c03fec
...@@ -30,6 +30,10 @@ public class BaseOrder implements Serializable { ...@@ -30,6 +30,10 @@ public class BaseOrder implements Serializable {
public static final int ORDER_SIGN_APPLY = 2; public static final int ORDER_SIGN_APPLY = 2;
public static final int ORDER_SIGN_SPECIAL = 3; public static final int ORDER_SIGN_SPECIAL = 3;
public static final int INSURE_STATUS_NOT = 0;
public static final int INSURE_STATUS_BUY = 1;
public static final int INSURE_STATUS_CNL = 2;
/** /**
* 主键 * 主键
*/ */
......
...@@ -8,6 +8,13 @@ import java.util.List; ...@@ -8,6 +8,13 @@ import java.util.List;
@Data @Data
public class BgPageDTO extends PageParam { public class BgPageDTO extends PageParam {
private String keyWord;
private String price;
private Integer status;
private Long orderStartTime;
private Long orderEndTime;
private Long refundStartTime;
private Long refundEndTime;
private String no; private String no;
private String insurePic; private String insurePic;
private List<OrderPersonInsurance> insuranceList; private List<OrderPersonInsurance> insuranceList;
......
...@@ -83,6 +83,7 @@ import java.util.stream.Collectors; ...@@ -83,6 +83,7 @@ import java.util.stream.Collectors;
import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.*; import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.*;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE; import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE; import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
import static com.xxfc.platform.order.entity.OrderPersonInsurance.STATUS_PAY;
import static com.xxfc.platform.order.pojo.mq.OrderMQDTO.*; import static com.xxfc.platform.order.pojo.mq.OrderMQDTO.*;
import static com.xxfc.platform.universal.constant.DictionaryKey.ILLEGAL_TYPE; import static com.xxfc.platform.universal.constant.DictionaryKey.ILLEGAL_TYPE;
...@@ -116,6 +117,9 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements ...@@ -116,6 +117,9 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
@Autowired @Autowired
OrderAccountBiz orderAccountBiz; OrderAccountBiz orderAccountBiz;
@Autowired
OrderPersonInsuranceBiz orderPersonInsuranceBiz;
@Autowired @Autowired
VehicleFeign vehicleFeign; VehicleFeign vehicleFeign;
...@@ -843,6 +847,17 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements ...@@ -843,6 +847,17 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
}}); }});
} }
} }
if(BaseOrder.INSURE_STATUS_BUY == baseOrder.getInsureStatus()) {
List<OrderPersonInsurance> insuranceList = orderPersonInsuranceBiz.selectList(new OrderPersonInsurance(){{
setOrderId(baseOrder.getId());
}});
//更新 申请状态
insuranceList.forEach( insurance -> {
insurance.setStatus(STATUS_PAY);
insurance.setPaytime(DateUtil.date().getTime());
});
}
} finally { } finally {
AppUserDTO appUserDTO = userFeign.userDetailById(baseOrder.getUserId()).getData(); AppUserDTO appUserDTO = userFeign.userDetailById(baseOrder.getUserId()).getData();
......
...@@ -28,7 +28,7 @@ import java.util.Map; ...@@ -28,7 +28,7 @@ import java.util.Map;
@RestController @RestController
@RequestMapping("/background/orderPersonInsurance") @RequestMapping("/background/orderPersonInsurance")
@Slf4j @Slf4j
public class PgOrderPersonInsuranceController extends BaseController<OrderPersonInsuranceBiz, OrderPersonInsurance> { public class BgOrderPersonInsuranceController extends BaseController<OrderPersonInsuranceBiz, OrderPersonInsurance> {
@Autowired @Autowired
BaseOrderBiz baseOrderBiz; BaseOrderBiz baseOrderBiz;
...@@ -40,9 +40,9 @@ public class PgOrderPersonInsuranceController extends BaseController<OrderPerson ...@@ -40,9 +40,9 @@ public class PgOrderPersonInsuranceController extends BaseController<OrderPerson
} }
@ApiOperation("修改图片") @ApiOperation("修改图片")
@RequestMapping(value = "/editPic",method = RequestMethod.GET) @RequestMapping(value = "/editPic",method = RequestMethod.POST)
@ResponseBody @ResponseBody
public ObjectRestResponse editPic(BgPageDTO dto){ public ObjectRestResponse editPic(@RequestBody BgPageDTO dto){
baseOrderBiz.updateByWeekendSelective(new BaseOrder(){{ baseOrderBiz.updateByWeekendSelective(new BaseOrder(){{
setInsurePic(dto.getInsurePic()); setInsurePic(dto.getInsurePic());
}}, w -> { }}, w -> {
...@@ -52,7 +52,7 @@ public class PgOrderPersonInsuranceController extends BaseController<OrderPerson ...@@ -52,7 +52,7 @@ public class PgOrderPersonInsuranceController extends BaseController<OrderPerson
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
@RequestMapping(value="/bg/pageExport", method = RequestMethod.GET) @RequestMapping(value="/pageExport", method = RequestMethod.GET)
public void bgPageExport(BgPageDTO dto) throws Exception{ public void bgPageExport(BgPageDTO dto) throws Exception{
PageExportDTO head = new PageExportDTO(){{ PageExportDTO head = new PageExportDTO(){{
setOrderNo("订单编号"); setOrderNo("订单编号");
......
...@@ -483,7 +483,6 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -483,7 +483,6 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
, VehicleItemDTO.class); , VehicleItemDTO.class);
OrderItem driverOrderItem = orderItemBiz.initOrderItem(DRIVER_PRICE, detail.getDayNum(), "平台司机", null, ItemTypeEnum.DRIVER); OrderItem driverOrderItem = orderItemBiz.initOrderItem(DRIVER_PRICE, detail.getDayNum(), "平台司机", null, ItemTypeEnum.DRIVER);
OrderItem damageSafeOrderItem = orderItemBiz.initOrderItem(DAMAGE_SAFE, detail.getDayNum(), "免赔费用", null, ItemTypeEnum.DAMAGE_SAFE); OrderItem damageSafeOrderItem = orderItemBiz.initOrderItem(DAMAGE_SAFE, detail.getDayNum(), "免赔费用", null, ItemTypeEnum.DAMAGE_SAFE);
// OrderItem personInsuranceOrderItem = orderItemBiz.initOrderItem(DAMAGE_SAFE, detail.getDayNum(), "免赔费用", null, ItemTypeEnum.PERSON_INSURANCE);
detail.setItems(new ArrayList<OrderItem>()); detail.setItems(new ArrayList<OrderItem>());
detail.getItems().add(vehicleOrderItem); detail.getItems().add(vehicleOrderItem);
......
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
</resultMap> </resultMap>
<select id="selectOrderInfo" resultType="com.xxfc.platform.order.pojo.personinsurance.BgPageVO"> <select id="selectOrderInfo" resultType="com.xxfc.platform.order.pojo.personinsurance.BgPageVO">
select distinct ob.no, ob.insure_pic select distinct bo.no, bo.insure_pic
<include refid="commonFromWhere"></include> <include refid="commonFromWhere"></include>
order by order by
ob.no desc bo.no desc
</select> </select>
<select id="selectInsuranceInfo" resultType="com.xxfc.platform.order.entity.OrderPersonInsurance"> <select id="selectInsuranceInfo" resultType="com.xxfc.platform.order.entity.OrderPersonInsurance">
...@@ -34,17 +34,17 @@ ...@@ -34,17 +34,17 @@
<include refid="commonFromWhere"></include> <include refid="commonFromWhere"></include>
order by order by
ob.no desc bo.no desc
</select> </select>
<sql id="commonFromWhere"> <sql id="commonFromWhere">
from order_person_insurance opi from order_person_insurance opi
left join order_base ob on opi.id = ob.order_id left join base_order bo on opi.order_id = bo.id
<where> <where>
and ob.has_pay = 1 and bo.has_pay = 1
<if test="keyWord != null"> <if test="keyWord != null">
and ( and (
ob.no like concat('%',#{keyWord},'%') or opi.name like concat('%',#{keyWord},'%') bo.no like concat('%',#{keyWord},'%') or opi.name like concat('%',#{keyWord},'%')
) )
</if> </if>
<if test="price != null"> <if test="price != null">
...@@ -57,13 +57,13 @@ ...@@ -57,13 +57,13 @@
and opi.pay_time &gt;= #{orderStartTime} and opi.pay_time &gt;= #{orderStartTime}
</if> </if>
<if test="orderEndTime != null"> <if test="orderEndTime != null">
and ob.pay_time &lt;= #{orderEndTime} and bo.pay_time &lt;= #{orderEndTime}
</if> </if>
<if test="refundStartTime != null"> <if test="refundStartTime != null">
and opi.refund_time &gt;= #{refundStartTime} and opi.refund_time &gt;= #{refundStartTime}
</if> </if>
<if test="refundEndTime != null"> <if test="refundEndTime != null">
and ob.refund_time &lt;= #{refundEndTime} and bo.refund_time &lt;= #{refundEndTime}
</if> </if>
</where> </where>
</sql> </sql>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment