| New file |
| | |
| | | package com.java110.dto.storeOrderCartEvent; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | | * @Description 购物车事件数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class StoreOrderCartEventDto extends PageDto implements Serializable { |
| | | |
| | | private String eventId; |
| | | private String eventMsg; |
| | | private String orderId; |
| | | private String cartId; |
| | | private String eventObjType; |
| | | private String eventObjId; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getEventId() { |
| | | return eventId; |
| | | } |
| | | public void setEventId(String eventId) { |
| | | this.eventId = eventId; |
| | | } |
| | | public String getEventMsg() { |
| | | return eventMsg; |
| | | } |
| | | public void setEventMsg(String eventMsg) { |
| | | this.eventMsg = eventMsg; |
| | | } |
| | | public String getOrderId() { |
| | | return orderId; |
| | | } |
| | | public void setOrderId(String orderId) { |
| | | this.orderId = orderId; |
| | | } |
| | | public String getCartId() { |
| | | return cartId; |
| | | } |
| | | public void setCartId(String cartId) { |
| | | this.cartId = cartId; |
| | | } |
| | | public String getEventObjType() { |
| | | return eventObjType; |
| | | } |
| | | public void setEventObjType(String eventObjType) { |
| | | this.eventObjType = eventObjType; |
| | | } |
| | | public String getEventObjId() { |
| | | return eventObjId; |
| | | } |
| | | public void setEventObjId(String eventObjId) { |
| | | this.eventObjId = eventObjId; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.po.storeOrderCartEvent; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class StoreOrderCartEventPo implements Serializable { |
| | | |
| | | private String eventId; |
| | | private String eventMsg; |
| | | private String orderId; |
| | | private String cartId; |
| | | private String eventObjType; |
| | | private String eventObjId; |
| | | public String getEventId() { |
| | | return eventId; |
| | | } |
| | | public void setEventId(String eventId) { |
| | | this.eventId = eventId; |
| | | } |
| | | public String getEventMsg() { |
| | | return eventMsg; |
| | | } |
| | | public void setEventMsg(String eventMsg) { |
| | | this.eventMsg = eventMsg; |
| | | } |
| | | public String getOrderId() { |
| | | return orderId; |
| | | } |
| | | public void setOrderId(String orderId) { |
| | | this.orderId = orderId; |
| | | } |
| | | public String getCartId() { |
| | | return cartId; |
| | | } |
| | | public void setCartId(String cartId) { |
| | | this.cartId = cartId; |
| | | } |
| | | public String getEventObjType() { |
| | | return eventObjType; |
| | | } |
| | | public void setEventObjType(String eventObjType) { |
| | | this.eventObjType = eventObjType; |
| | | } |
| | | public String getEventObjId() { |
| | | return eventObjId; |
| | | } |
| | | public void setEventObjId(String eventObjId) { |
| | | this.eventObjId = eventObjId; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | public static final String CODE_PREFIX_orderId = "96"; |
| | | public static final String CODE_PREFIX_oaId = "97"; |
| | | public static final String CODE_PREFIX_logId = "10"; |
| | | public static final String CODE_PREFIX_eventId = "11"; |
| | | |
| | | |
| | | |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="storeOrderCartEventServiceDaoImpl"> |
| | | |
| | | |
| | | <!-- 保存购物车事件信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveStoreOrderCartEventInfo" parameterType="Map"> |
| | | insert into store_order_cart_event( |
| | | event_id,event_msg,order_id,cart_id,event_obj_type,event_obj_id |
| | | ) values ( |
| | | #{eventId},#{eventMsg},#{orderId},#{cartId},#{eventObjType},#{eventObjId} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询购物车事件信息 add by wuxw 2018-07-03 --> |
| | | <select id="getStoreOrderCartEventInfo" parameterType="Map" resultType="Map"> |
| | | select t.event_id,t.event_id eventId,t.event_msg,t.event_msg eventMsg,t.order_id,t.order_id |
| | | orderId,t.cart_id,t.cart_id cartId,t.event_obj_type,t.event_obj_type eventObjType,t.event_obj_id,t.event_obj_id |
| | | eventObjId |
| | | from store_order_cart_event t |
| | | where 1 =1 |
| | | <if test="eventId !=null and eventId != ''"> |
| | | and t.event_id= #{eventId} |
| | | </if> |
| | | <if test="eventMsg !=null and eventMsg != ''"> |
| | | and t.event_msg= #{eventMsg} |
| | | </if> |
| | | <if test="orderId !=null and orderId != ''"> |
| | | and t.order_id= #{orderId} |
| | | </if> |
| | | <if test="cartId !=null and cartId != ''"> |
| | | and t.cart_id= #{cartId} |
| | | </if> |
| | | <if test="eventObjType !=null and eventObjType != ''"> |
| | | and t.event_obj_type= #{eventObjType} |
| | | </if> |
| | | <if test="eventObjId !=null and eventObjId != ''"> |
| | | and t.event_obj_id= #{eventObjId} |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <!-- 修改购物车事件信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateStoreOrderCartEventInfo" parameterType="Map"> |
| | | update store_order_cart_event t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="eventMsg !=null and eventMsg != ''"> |
| | | , t.event_msg= #{eventMsg} |
| | | </if> |
| | | <if test="orderId !=null and orderId != ''"> |
| | | , t.order_id= #{orderId} |
| | | </if> |
| | | <if test="cartId !=null and cartId != ''"> |
| | | , t.cart_id= #{cartId} |
| | | </if> |
| | | <if test="eventObjType !=null and eventObjType != ''"> |
| | | , t.event_obj_type= #{eventObjType} |
| | | </if> |
| | | <if test="eventObjId !=null and eventObjId != ''"> |
| | | , t.event_obj_id= #{eventObjId} |
| | | </if> |
| | | where 1=1 |
| | | <if test="eventId !=null and eventId != ''"> |
| | | and t.event_id= #{eventId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询购物车事件数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryStoreOrderCartEventsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from store_order_cart_event t |
| | | where 1 =1 |
| | | <if test="eventId !=null and eventId != ''"> |
| | | and t.event_id= #{eventId} |
| | | </if> |
| | | <if test="eventMsg !=null and eventMsg != ''"> |
| | | and t.event_msg= #{eventMsg} |
| | | </if> |
| | | <if test="orderId !=null and orderId != ''"> |
| | | and t.order_id= #{orderId} |
| | | </if> |
| | | <if test="cartId !=null and cartId != ''"> |
| | | and t.cart_id= #{cartId} |
| | | </if> |
| | | <if test="eventObjType !=null and eventObjType != ''"> |
| | | and t.event_obj_type= #{eventObjType} |
| | | </if> |
| | | <if test="eventObjId !=null and eventObjId != ''"> |
| | | and t.event_obj_id= #{eventObjId} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | { |
| | | "autoMove": true, |
| | | "id": "logId", |
| | | "name": "transactionLogMessage", |
| | | "desc": "交互日志", |
| | | "shareParam": "logId", |
| | | "shareColumn": "log_id", |
| | | "shareName": "common", |
| | | "tableName": "transaction_log_message", |
| | | "id": "eventId", |
| | | "name": "storeOrderCartEvent", |
| | | "desc": "购物车事件", |
| | | "shareParam": "eventId", |
| | | "shareColumn": "event_id", |
| | | "shareName": "goods", |
| | | "tableName": "store_order_cart_event", |
| | | "param": { |
| | | "logId": "log_id", |
| | | "requestHeader": "request_header", |
| | | "responseHeader": "response_header", |
| | | "requestMessage": "request_message", |
| | | "responseMessage": "response_message" |
| | | "eventId": "event_id", |
| | | "orderId": "order_id", |
| | | "cartId": "cart_id", |
| | | "eventObjType": "event_obj_type", |
| | | "eventObjId": "event_obj_id", |
| | | "eventMsg": "event_msg" |
| | | }, |
| | | "required": [ |
| | | { |
| | | "code": "logId", |
| | | "msg": "日志ID不能为空" |
| | | "code": "orderId", |
| | | "msg": "订单ID不能为空" |
| | | } |
| | | ] |
| | | } |
| New file |
| | |
| | | package com.java110.intf.goods; |
| | | |
| | | import com.java110.config.feign.FeignConfiguration; |
| | | import com.java110.dto.storeOrderCartEvent.StoreOrderCartEventDto; |
| | | import com.java110.po.storeOrderCartEvent.StoreOrderCartEventPo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName IStoreOrderCartEventInnerServiceSMO |
| | | * @Description 购物车事件接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "goods-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/storeOrderCartEventApi") |
| | | public interface IStoreOrderCartEventInnerServiceSMO { |
| | | |
| | | |
| | | @RequestMapping(value = "/saveStoreOrderCartEvent", method = RequestMethod.POST) |
| | | public int saveStoreOrderCartEvent(@RequestBody StoreOrderCartEventPo storeOrderCartEventPo); |
| | | |
| | | @RequestMapping(value = "/updateStoreOrderCartEvent", method = RequestMethod.POST) |
| | | public int updateStoreOrderCartEvent(@RequestBody StoreOrderCartEventPo storeOrderCartEventPo); |
| | | |
| | | @RequestMapping(value = "/deleteStoreOrderCartEvent", method = RequestMethod.POST) |
| | | public int deleteStoreOrderCartEvent(@RequestBody StoreOrderCartEventPo storeOrderCartEventPo); |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param storeOrderCartEventDto 数据对象分享 |
| | | * @return StoreOrderCartEventDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryStoreOrderCartEvents", method = RequestMethod.POST) |
| | | List<StoreOrderCartEventDto> queryStoreOrderCartEvents(@RequestBody StoreOrderCartEventDto storeOrderCartEventDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param storeOrderCartEventDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryStoreOrderCartEventsCount", method = RequestMethod.POST) |
| | | int queryStoreOrderCartEventsCount(@RequestBody StoreOrderCartEventDto storeOrderCartEventDto); |
| | | } |
| | |
| | | import com.java110.dto.storeOrder.StoreOrderDto; |
| | | import com.java110.dto.storeOrderAddress.StoreOrderAddressDto; |
| | | import com.java110.dto.storeOrderCart.StoreOrderCartDto; |
| | | import com.java110.dto.storeOrderCartEvent.StoreOrderCartEventDto; |
| | | import com.java110.goods.bmo.storeCart.IDeleteStoreCartBMO; |
| | | import com.java110.goods.bmo.storeCart.IGetStoreCartBMO; |
| | | import com.java110.goods.bmo.storeCart.ISaveStoreCartBMO; |
| | |
| | | import com.java110.goods.bmo.storeOrderCart.IGetStoreOrderCartBMO; |
| | | import com.java110.goods.bmo.storeOrderCart.ISaveStoreOrderCartBMO; |
| | | import com.java110.goods.bmo.storeOrderCart.IUpdateStoreOrderCartBMO; |
| | | import com.java110.goods.bmo.storeOrderCartEvent.IGetStoreOrderCartEventBMO; |
| | | import com.java110.po.storeCart.StoreCartPo; |
| | | import com.java110.po.storeOrder.StoreOrderPo; |
| | | import com.java110.po.storeOrderAddress.StoreOrderAddressPo; |
| | |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestHeader; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * 商户订单 |
| | |
| | | |
| | | @Autowired |
| | | private IGetStoreOrderAddressBMO getStoreOrderAddressBMOImpl; |
| | | |
| | | @Autowired |
| | | private IGetStoreOrderCartEventBMO getStoreOrderCartEventBMOImpl; |
| | | |
| | | /** |
| | | * 微信保存消息模板 |
| | |
| | | storeOrderAddressDto.setOrderId(orderId); |
| | | return getStoreOrderAddressBMOImpl.get(storeOrderAddressDto); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param cartId 购物车ID |
| | | * @return |
| | | * @serviceCode /storeOrderCartEvent/queryStoreOrderCartEvent |
| | | * @path /app/storeOrderCartEvent/queryStoreOrderCartEvent |
| | | */ |
| | | @RequestMapping(value = "/queryStoreOrderCartEvent", method = RequestMethod.GET) |
| | | public ResponseEntity<String> queryStoreOrderCartEvent(@RequestParam(value = "cartId") String cartId, |
| | | @RequestParam(value = "orderId") String orderId, |
| | | @RequestParam(value = "page") int page, |
| | | @RequestParam(value = "row") int row) { |
| | | StoreOrderCartEventDto storeOrderCartEventDto = new StoreOrderCartEventDto(); |
| | | storeOrderCartEventDto.setPage(page); |
| | | storeOrderCartEventDto.setRow(row); |
| | | storeOrderCartEventDto.setCartId(cartId); |
| | | storeOrderCartEventDto.setOrderId(orderId); |
| | | return getStoreOrderCartEventBMOImpl.get(storeOrderCartEventDto); |
| | | } |
| | | } |
| | |
| | | import com.java110.dto.storeOrderCart.StoreOrderCartDto; |
| | | import com.java110.dto.userAddress.UserAddressDto; |
| | | import com.java110.goods.bmo.storeOrder.ISaveStoreOrderBMO; |
| | | import com.java110.intf.goods.IStoreOrderAddressInnerServiceSMO; |
| | | import com.java110.intf.goods.IStoreOrderCartInnerServiceSMO; |
| | | import com.java110.intf.goods.IStoreOrderInnerServiceSMO; |
| | | import com.java110.intf.user.IUserAddressInnerServiceSMO; |
| | | import com.java110.intf.goods.IGroupBuyProductSpecInnerServiceSMO; |
| | | import com.java110.intf.goods.IProductInnerServiceSMO; |
| | | import com.java110.intf.goods.IProductSpecValueInnerServiceSMO; |
| | | import com.java110.intf.goods.IStoreOrderAddressInnerServiceSMO; |
| | | import com.java110.intf.goods.IStoreOrderCartEventInnerServiceSMO; |
| | | import com.java110.intf.goods.IStoreOrderCartInnerServiceSMO; |
| | | import com.java110.intf.goods.IStoreOrderInnerServiceSMO; |
| | | import com.java110.intf.user.IUserAddressInnerServiceSMO; |
| | | import com.java110.po.groupBuyProductSpec.GroupBuyProductSpecPo; |
| | | import com.java110.po.productSpecValue.ProductSpecValuePo; |
| | | import com.java110.po.storeOrder.StoreOrderPo; |
| | | import com.java110.po.storeOrderAddress.StoreOrderAddressPo; |
| | | import com.java110.po.storeOrderCart.StoreOrderCartPo; |
| | | import com.java110.po.storeOrderCartEvent.StoreOrderCartEventPo; |
| | | import com.java110.utils.lock.DistributedLock; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.StringUtil; |
| | |
| | | |
| | | @Autowired |
| | | private IStoreOrderAddressInnerServiceSMO storeOrderAddressInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IStoreOrderCartEventInnerServiceSMO storeOrderCartEventInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | |
| | | throw new IllegalArgumentException("保存购物车失败"); |
| | | } |
| | | |
| | | StoreOrderCartEventPo storeOrderCartEventPo = new StoreOrderCartEventPo(); |
| | | storeOrderCartEventPo.setCartId(storeOrderCartPo.getCartId()); |
| | | storeOrderCartEventPo.setOrderId(storeOrderCartPo.getOrderId()); |
| | | storeOrderCartEventPo.setEventId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_eventId)); |
| | | storeOrderCartEventPo.setEventObjType("U"); |
| | | storeOrderCartEventPo.setEventObjId(storeOrderPo.getPersonId()); |
| | | storeOrderCartEventPo.setEventMsg("用户下单"); |
| | | |
| | | flag = storeOrderCartEventInnerServiceSMOImpl.saveStoreOrderCartEvent(storeOrderCartEventPo); |
| | | |
| | | if (flag < 1) { |
| | | throw new IllegalArgumentException("保存购物车事件失败"); |
| | | } |
| | | |
| | | BigDecimal orderPayPrice = new BigDecimal(Double.parseDouble(storeOrderPo.getPayPrice())); |
| | | |
| | | double oPayPrice = orderPayPrice.add(new BigDecimal(Double.parseDouble(payPrice))).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
| | |
| | | import com.java110.dto.storeOrder.StoreOrderDto; |
| | | import com.java110.dto.storeOrderCart.StoreOrderCartDto; |
| | | import com.java110.goods.bmo.storeOrder.IUpdateStoreOrderBMO; |
| | | import com.java110.intf.goods.IStoreOrderCartInnerServiceSMO; |
| | | import com.java110.intf.goods.IStoreOrderInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeDetailInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeInnerServiceSMO; |
| | | import com.java110.intf.goods.IGroupBuyInnerServiceSMO; |
| | | import com.java110.intf.goods.IGroupBuyProductInnerServiceSMO; |
| | | import com.java110.intf.goods.IProductSpecValueInnerServiceSMO; |
| | | import com.java110.intf.goods.IStoreCartInnerServiceSMO; |
| | | import com.java110.intf.goods.IStoreOrderCartEventInnerServiceSMO; |
| | | import com.java110.intf.goods.IStoreOrderCartInnerServiceSMO; |
| | | import com.java110.intf.goods.IStoreOrderInnerServiceSMO; |
| | | import com.java110.po.fee.PayFeeDetailPo; |
| | | import com.java110.po.fee.PayFeePo; |
| | | import com.java110.po.groupBuy.GroupBuyPo; |
| | | import com.java110.po.storeCart.StoreCartPo; |
| | | import com.java110.po.storeOrder.StoreOrderPo; |
| | | import com.java110.po.storeOrderCart.StoreOrderCartPo; |
| | | import com.java110.po.storeOrderCartEvent.StoreOrderCartEventPo; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.vo.ResultVo; |
| | |
| | | @Autowired |
| | | private IFeeDetailInnerServiceSMO feeDetailInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IStoreOrderCartEventInnerServiceSMO storeOrderCartEventInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param storeOrderPo |
| | | * @return 订单服务能够接受的报文 |
| | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存购物车失败"); |
| | | } |
| | | |
| | | StoreOrderCartEventPo storeOrderCartEventPo = new StoreOrderCartEventPo(); |
| | | storeOrderCartEventPo.setCartId(storeOrderCartPo.getCartId()); |
| | | storeOrderCartEventPo.setOrderId(storeOrderCartPo.getOrderId()); |
| | | storeOrderCartEventPo.setEventId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_eventId)); |
| | | storeOrderCartEventPo.setEventObjType("U"); |
| | | storeOrderCartEventPo.setEventObjId(storeOrderPo.getPersonId()); |
| | | storeOrderCartEventPo.setEventMsg("用户支付完成"); |
| | | flag = storeOrderCartEventInnerServiceSMOImpl.saveStoreOrderCartEvent(storeOrderCartEventPo); |
| | | if (flag < 1) { |
| | | throw new IllegalArgumentException("保存购物车事件失败"); |
| | | } |
| | | |
| | | |
| | | for (StoreOrderCartDto tmpStoreOrderCartDto : storeOrderCartDtos) { |
| | | doDealStoreCart(tmpStoreOrderCartDto); |
| New file |
| | |
| | | package com.java110.goods.bmo.storeOrderCartEvent; |
| | | |
| | | import com.java110.po.storeOrderCartEvent.StoreOrderCartEventPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IDeleteStoreOrderCartEventBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改购物车事件 |
| | | * add by wuxw |
| | | * |
| | | * @param storeOrderCartEventPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> delete(StoreOrderCartEventPo storeOrderCartEventPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.storeOrderCartEvent; |
| | | import com.java110.dto.storeOrderCartEvent.StoreOrderCartEventDto; |
| | | import org.springframework.http.ResponseEntity; |
| | | public interface IGetStoreOrderCartEventBMO { |
| | | |
| | | |
| | | /** |
| | | * 查询购物车事件 |
| | | * add by wuxw |
| | | * @param storeOrderCartEventDto |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> get(StoreOrderCartEventDto storeOrderCartEventDto); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.storeOrderCartEvent; |
| | | |
| | | import com.java110.po.storeOrderCartEvent.StoreOrderCartEventPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | public interface ISaveStoreOrderCartEventBMO { |
| | | |
| | | |
| | | /** |
| | | * 添加购物车事件 |
| | | * add by wuxw |
| | | * @param storeOrderCartEventPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> save(StoreOrderCartEventPo storeOrderCartEventPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.storeOrderCartEvent; |
| | | |
| | | import com.java110.po.storeOrderCartEvent.StoreOrderCartEventPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IUpdateStoreOrderCartEventBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改购物车事件 |
| | | * add by wuxw |
| | | * |
| | | * @param storeOrderCartEventPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> update(StoreOrderCartEventPo storeOrderCartEventPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.storeOrderCartEvent.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.goods.bmo.storeOrderCartEvent.IDeleteStoreOrderCartEventBMO; |
| | | import com.java110.intf.goods.IStoreOrderCartEventInnerServiceSMO; |
| | | import com.java110.po.storeOrderCartEvent.StoreOrderCartEventPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("deleteStoreOrderCartEventBMOImpl") |
| | | public class DeleteStoreOrderCartEventBMOImpl implements IDeleteStoreOrderCartEventBMO { |
| | | |
| | | @Autowired |
| | | private IStoreOrderCartEventInnerServiceSMO storeOrderCartEventInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param storeOrderCartEventPo 数据 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> delete(StoreOrderCartEventPo storeOrderCartEventPo) { |
| | | |
| | | int flag = storeOrderCartEventInnerServiceSMOImpl.deleteStoreOrderCartEvent(storeOrderCartEventPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.storeOrderCartEvent.impl; |
| | | |
| | | import com.java110.dto.storeOrderCartEvent.StoreOrderCartEventDto; |
| | | import com.java110.goods.bmo.storeOrderCartEvent.IGetStoreOrderCartEventBMO; |
| | | import com.java110.intf.goods.IStoreOrderCartEventInnerServiceSMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service("getStoreOrderCartEventBMOImpl") |
| | | public class GetStoreOrderCartEventBMOImpl implements IGetStoreOrderCartEventBMO { |
| | | |
| | | @Autowired |
| | | private IStoreOrderCartEventInnerServiceSMO storeOrderCartEventInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param storeOrderCartEventDto |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public ResponseEntity<String> get(StoreOrderCartEventDto storeOrderCartEventDto) { |
| | | |
| | | |
| | | int count = storeOrderCartEventInnerServiceSMOImpl.queryStoreOrderCartEventsCount(storeOrderCartEventDto); |
| | | |
| | | List<StoreOrderCartEventDto> storeOrderCartEventDtos = null; |
| | | if (count > 0) { |
| | | storeOrderCartEventDtos = storeOrderCartEventInnerServiceSMOImpl.queryStoreOrderCartEvents(storeOrderCartEventDto); |
| | | } else { |
| | | storeOrderCartEventDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) storeOrderCartEventDto.getRow()), count, storeOrderCartEventDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.storeOrderCartEvent.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.goods.bmo.storeOrderCartEvent.ISaveStoreOrderCartEventBMO; |
| | | import com.java110.intf.goods.IStoreOrderCartEventInnerServiceSMO; |
| | | import com.java110.po.storeOrderCartEvent.StoreOrderCartEventPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("saveStoreOrderCartEventBMOImpl") |
| | | public class SaveStoreOrderCartEventBMOImpl implements ISaveStoreOrderCartEventBMO { |
| | | |
| | | @Autowired |
| | | private IStoreOrderCartEventInnerServiceSMO storeOrderCartEventInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param storeOrderCartEventPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> save(StoreOrderCartEventPo storeOrderCartEventPo) { |
| | | |
| | | storeOrderCartEventPo.setEventId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_eventId)); |
| | | int flag = storeOrderCartEventInnerServiceSMOImpl.saveStoreOrderCartEvent(storeOrderCartEventPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.storeOrderCartEvent.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.goods.bmo.storeOrderCartEvent.IUpdateStoreOrderCartEventBMO; |
| | | import com.java110.intf.goods.IStoreOrderCartEventInnerServiceSMO; |
| | | import com.java110.po.storeOrderCartEvent.StoreOrderCartEventPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("updateStoreOrderCartEventBMOImpl") |
| | | public class UpdateStoreOrderCartEventBMOImpl implements IUpdateStoreOrderCartEventBMO { |
| | | |
| | | @Autowired |
| | | private IStoreOrderCartEventInnerServiceSMO storeOrderCartEventInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param storeOrderCartEventPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> update(StoreOrderCartEventPo storeOrderCartEventPo) { |
| | | |
| | | int flag = storeOrderCartEventInnerServiceSMOImpl.updateStoreOrderCartEvent(storeOrderCartEventPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.dao; |
| | | |
| | | |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.entity.merchant.BoMerchant; |
| | | import com.java110.entity.merchant.BoMerchantAttr; |
| | | import com.java110.entity.merchant.Merchant; |
| | | import com.java110.entity.merchant.MerchantAttr; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 购物车事件组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 购物车事件服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface IStoreOrderCartEventServiceDao { |
| | | |
| | | |
| | | /** |
| | | * 保存 购物车事件信息 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveStoreOrderCartEventInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询购物车事件信息(instance过程) |
| | | * 根据bId 查询购物车事件信息 |
| | | * @param info bId 信息 |
| | | * @return 购物车事件信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getStoreOrderCartEventInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改购物车事件信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateStoreOrderCartEventInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询购物车事件总数 |
| | | * |
| | | * @param info 购物车事件信息 |
| | | * @return 购物车事件数量 |
| | | */ |
| | | int queryStoreOrderCartEventsCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.goods.dao.IStoreOrderCartEventServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 购物车事件服务 与数据库交互 |
| | | * Created by wuxw on 2017/4/5. |
| | | */ |
| | | @Service("storeOrderCartEventServiceDaoImpl") |
| | | //@Transactional |
| | | public class StoreOrderCartEventServiceDaoImpl extends BaseServiceDao implements IStoreOrderCartEventServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(StoreOrderCartEventServiceDaoImpl.class); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存购物车事件信息 到 instance |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveStoreOrderCartEventInfo(Map info) throws DAOException { |
| | | logger.debug("保存购物车事件信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("storeOrderCartEventServiceDaoImpl.saveStoreOrderCartEventInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存购物车事件信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询购物车事件信息(instance) |
| | | * @param info bId 信息 |
| | | * @return List<Map> |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getStoreOrderCartEventInfo(Map info) throws DAOException { |
| | | logger.debug("查询购物车事件信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessStoreOrderCartEventInfos = sqlSessionTemplate.selectList("storeOrderCartEventServiceDaoImpl.getStoreOrderCartEventInfo",info); |
| | | |
| | | return businessStoreOrderCartEventInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改购物车事件信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateStoreOrderCartEventInfo(Map info) throws DAOException { |
| | | logger.debug("修改购物车事件信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("storeOrderCartEventServiceDaoImpl.updateStoreOrderCartEventInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改购物车事件信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询购物车事件数量 |
| | | * @param info 购物车事件信息 |
| | | * @return 购物车事件数量 |
| | | */ |
| | | @Override |
| | | public int queryStoreOrderCartEventsCount(Map info) { |
| | | logger.debug("查询购物车事件数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessStoreOrderCartEventInfos = sqlSessionTemplate.selectList("storeOrderCartEventServiceDaoImpl.queryStoreOrderCartEventsCount", info); |
| | | if (businessStoreOrderCartEventInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessStoreOrderCartEventInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.smo.impl; |
| | | |
| | | |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.storeOrderCartEvent.StoreOrderCartEventDto; |
| | | import com.java110.goods.dao.IStoreOrderCartEventServiceDao; |
| | | import com.java110.intf.goods.IStoreOrderCartEventInnerServiceSMO; |
| | | import com.java110.po.storeOrderCartEvent.StoreOrderCartEventPo; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorInnerServiceSMOImpl |
| | | * @Description 购物车事件内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class StoreOrderCartEventInnerServiceSMOImpl extends BaseServiceSMO implements IStoreOrderCartEventInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private IStoreOrderCartEventServiceDao storeOrderCartEventServiceDaoImpl; |
| | | |
| | | |
| | | @Override |
| | | public int saveStoreOrderCartEvent(@RequestBody StoreOrderCartEventPo storeOrderCartEventPo) { |
| | | int saveFlag = 1; |
| | | storeOrderCartEventServiceDaoImpl.saveStoreOrderCartEventInfo(BeanConvertUtil.beanCovertMap(storeOrderCartEventPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int updateStoreOrderCartEvent(@RequestBody StoreOrderCartEventPo storeOrderCartEventPo) { |
| | | int saveFlag = 1; |
| | | storeOrderCartEventServiceDaoImpl.updateStoreOrderCartEventInfo(BeanConvertUtil.beanCovertMap(storeOrderCartEventPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteStoreOrderCartEvent(@RequestBody StoreOrderCartEventPo storeOrderCartEventPo) { |
| | | int saveFlag = 1; |
| | | storeOrderCartEventServiceDaoImpl.updateStoreOrderCartEventInfo(BeanConvertUtil.beanCovertMap(storeOrderCartEventPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public List<StoreOrderCartEventDto> queryStoreOrderCartEvents(@RequestBody StoreOrderCartEventDto storeOrderCartEventDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = storeOrderCartEventDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | storeOrderCartEventDto.setPage((page - 1) * storeOrderCartEventDto.getRow()); |
| | | } |
| | | |
| | | List<StoreOrderCartEventDto> storeOrderCartEvents = BeanConvertUtil.covertBeanList(storeOrderCartEventServiceDaoImpl.getStoreOrderCartEventInfo(BeanConvertUtil.beanCovertMap(storeOrderCartEventDto)), StoreOrderCartEventDto.class); |
| | | |
| | | return storeOrderCartEvents; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int queryStoreOrderCartEventsCount(@RequestBody StoreOrderCartEventDto storeOrderCartEventDto) { |
| | | return storeOrderCartEventServiceDaoImpl.queryStoreOrderCartEventsCount(BeanConvertUtil.beanCovertMap(storeOrderCartEventDto)); |
| | | } |
| | | |
| | | public IStoreOrderCartEventServiceDao getStoreOrderCartEventServiceDaoImpl() { |
| | | return storeOrderCartEventServiceDaoImpl; |
| | | } |
| | | |
| | | public void setStoreOrderCartEventServiceDaoImpl(IStoreOrderCartEventServiceDao storeOrderCartEventServiceDaoImpl) { |
| | | this.storeOrderCartEventServiceDaoImpl = storeOrderCartEventServiceDaoImpl; |
| | | } |
| | | } |