27 files modified
16 files added
| | |
| | | @ApiModelProperty("门牌号") |
| | | private String houseNumber; |
| | | |
| | | private String houseName; |
| | | |
| | | |
| | | @ApiModelProperty("回收金额") |
| | | private transient String money; |
| New file |
| | |
| | | package com.xzx.gc.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import javax.persistence.GeneratedValue; |
| | | import javax.persistence.GenerationType; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.Table; |
| | | |
| | | @Data |
| | | @Table(name = "xzx_sys_popup") |
| | | public class SysPopup { |
| | | |
| | | @Id |
| | | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| | | private Long id; |
| | | |
| | | //广告区域 1:首页2:其他 |
| | | private Integer area; |
| | | |
| | | //广告名称 |
| | | private String name; |
| | | |
| | | //弹窗人群:1:新用戶 2:老用戶 |
| | | private Integer aims; |
| | | |
| | | //弹窗规则:1:每日首次登录 2:每次登录 |
| | | private Integer rules; |
| | | |
| | | //是否跳转 1:是 2:否 |
| | | private Integer isOut; |
| | | |
| | | //内容链接 |
| | | private String outText; |
| | | |
| | | //开始日期 |
| | | private String startTime; |
| | | |
| | | //结束日期 |
| | | private String endTime; |
| | | |
| | | //上传图片 |
| | | private String img; |
| | | |
| | | //是否上架 1:是2:否 |
| | | private Integer state; |
| | | |
| | | } |
| | |
| | | import com.xzx.gc.order.dto.*; |
| | | import com.xzx.gc.order.mapper.*; |
| | | import com.xzx.gc.order.service.*; |
| | | import com.xzx.gc.order.vo.InviteUserOrderVo; |
| | | import com.xzx.gc.util.DoubleUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | return Result.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("邀请好友下单明细") |
| | | @ApiResponses( |
| | | @ApiResponse(code = 200, message = "success", response = InviteUserOrderVo.class) |
| | | ) |
| | | @PostMapping(value = Constants.ADMIN_VIEW_PREFIX + "/user/inviteUserQsOrderDetails.json") |
| | | public JsonResult<Object> inviteUserQsOrderDetails(@RequestBody InviteUserOrderDetailsDto detailsDto) { |
| | | return JsonResult.success(orderService.inviteUserOrderDetail(detailsDto)); |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | package com.xzx.gc.order.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2021-08-25 |
| | | **/ |
| | | @Data |
| | | @ApiModel(value = "InviteUserOrderDetailsDto", description = "邀请好友下单明细接收参数类") |
| | | public class InviteUserOrderDetailsDto { |
| | | |
| | | @ApiModelProperty(value = "第几页", required = true) |
| | | private int page; |
| | | |
| | | @ApiModelProperty(value = "每一页数量", required = true) |
| | | private int limit; |
| | | |
| | | @ApiModelProperty(value = "用户ID") |
| | | private String userId; |
| | | |
| | | @ApiModelProperty(value = "1-骑手单 2-集货员单") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private String phone; |
| | | } |
| | |
| | | |
| | | import com.xzx.gc.entity.JhyInfo; |
| | | import com.xzx.gc.entity.JhyOrder; |
| | | import com.xzx.gc.order.dto.InviteUserOrderDetailsDto; |
| | | import com.xzx.gc.order.dto.JhyOrderListDto; |
| | | import com.xzx.gc.order.vo.InviteUserOrderVo; |
| | | import com.xzx.gc.order.vo.JhyOrderListVo; |
| | | import com.xzx.gc.order.vo.JhyStatusCountVo; |
| | | import com.xzx.gc.util.GcMapper; |
| | |
| | | List<JhyOrder> selectJhyOrderListByStatus(@Param("list") List<String> list, @Param("userId") String userId); |
| | | |
| | | List<JhyOrder> selectJhyOrderNoWaitAndCancel(@Param("userId") String userId); |
| | | |
| | | List<InviteUserOrderVo> selectInviteUserOrderList(@Param("record") InviteUserOrderDetailsDto detailsDto); |
| | | } |
| | |
| | | import com.xzx.gc.model.user.UserInfoVo; |
| | | import com.xzx.gc.order.dto.CustomOrderDto; |
| | | import com.xzx.gc.order.dto.FindOrderByTimeDto; |
| | | import com.xzx.gc.order.dto.InviteUserOrderDetailsDto; |
| | | import com.xzx.gc.order.dto.OrderCustomDto; |
| | | import com.xzx.gc.order.vo.InviteUserOrderVo; |
| | | import com.xzx.gc.util.GcMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | |
| | | List<OrderInfo> selectOrderNoWaitAndCancel(@Param("userId") String userId); |
| | | |
| | | List<InviteUserOrderVo> selectInviteUserOrderList(@Param("record") InviteUserOrderDetailsDto detailsDto); |
| | | |
| | | List<OrderInfo> selectOrderWithWaitAndIng(@Param("userId") String userId); |
| | | } |
| | | |
| | |
| | | import cn.hutool.core.map.MapUtil; |
| | | import cn.hutool.core.text.StrBuilder; |
| | | import cn.hutool.core.util.NumberUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.github.pagehelper.PageHelper; |
| | |
| | | import com.xzx.gc.model.user.*; |
| | | import com.xzx.gc.order.dto.*; |
| | | import com.xzx.gc.order.mapper.*; |
| | | import com.xzx.gc.order.vo.InviteUserOrderVo; |
| | | import com.xzx.gc.service.AccountContext; |
| | | import com.xzx.gc.util.DoubleUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | @Autowired |
| | | private DistribService distribService; |
| | | |
| | | @Autowired |
| | | private JhyOrderMapper jhyOrderMapper; |
| | | |
| | | |
| | | public OrderReserveResDto getReserveTimeNew(OrderReserveResDto orderReserveResDto, String partnerId) { |
| | |
| | | throw new RestException(-3, "所选位置暂未开通服务"); |
| | | } |
| | | orderInfoReq.setTownId(townId); |
| | | } |
| | | |
| | | List<OrderInfo> orderInfos = orderMapper.selectOrderWithWaitAndIng(orderInfoReq.getCreateUserId()); |
| | | if (CollUtil.isNotEmpty(orderInfos)) { |
| | | String address = addressInfo.getAddressArea() + addressInfo.getDetailAddress() + addressInfo.getHouseName() + addressInfo.getUnitName() + addressInfo.getHouseNumber(); |
| | | for (OrderInfo orderInfo : orderInfos) { |
| | | orderInfoReq.setAddress(addressInfo.getDetailAddress()); |
| | | orderInfoReq.setAddressArea(addressInfo.getAddressArea()); |
| | | orderInfoReq.setUnitName(addressInfo.getUnitName()); |
| | | orderInfoReq.setHouseNumber(addressInfo.getHouseNumber()); |
| | | orderInfoReq.setHouseName(addressInfo.getHouseName()); |
| | | |
| | | String hasAddress = orderInfo.getAddressArea() + orderInfo.getAddress() + orderInfo.getHouseName() + addressInfo.getUnitName() + addressInfo.getHouseNumber(); |
| | | if (ObjectUtil.equal(address, hasAddress)) { |
| | | throw new RestException("该地址已经存在正在进行的订单"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | orderDetailService.updateAllById(orderDetailInfo); |
| | | } |
| | | |
| | | public PageInfo<InviteUserOrderVo> inviteUserOrderDetail(InviteUserOrderDetailsDto detailsDto) { |
| | | UserInfo userInfo = userMapper.selectByPrimaryKey(detailsDto.getUserId()); |
| | | if (userInfo == null) { |
| | | throw new RestException("用户不存在"); |
| | | } |
| | | |
| | | detailsDto.setPhone(userInfo.getMobilePhone()); |
| | | List<InviteUserOrderVo> orderVos = new ArrayList<>(); |
| | | PageHelper.startPage(detailsDto.getPage(), detailsDto.getLimit()); |
| | | if (detailsDto.getType() == 1) { |
| | | orderVos = orderMapper.selectInviteUserOrderList(detailsDto); |
| | | } else { |
| | | orderVos = jhyOrderMapper.selectInviteUserOrderList(detailsDto); |
| | | } |
| | | return new PageInfo<>(orderVos); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.xzx.gc.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2021-08-25 |
| | | **/ |
| | | @Data |
| | | @ApiModel(value = "InviteUserOrderVo", description = "邀请好友下单明细返回参数类") |
| | | public class InviteUserOrderVo { |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "用户名称") |
| | | private String username; |
| | | |
| | | @ApiModelProperty(value = "联系方式") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "订单用户") |
| | | private String orderName; |
| | | |
| | | @ApiModelProperty(value = "订单联系方式") |
| | | private String orderPhone; |
| | | |
| | | @ApiModelProperty(value = "预约时间") |
| | | private String time; |
| | | |
| | | @ApiModelProperty(value = "地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "回收类型") |
| | | private String recycleType; |
| | | |
| | | @ApiModelProperty(value = "环保币") |
| | | private BigDecimal coin; |
| | | |
| | | @ApiModelProperty(value = "积分") |
| | | private BigDecimal score; |
| | | |
| | | @ApiModelProperty(value = "状态 骑手(1为待接单,2为服务中,3为待确认,4为待入库,5为完成,6为取消,7为入库中) 集物员(1-待接单2-已接单3-已收款(用户)/待入库(集物员)4-已完成5-已取消)") |
| | | private Integer status; |
| | | } |
| | |
| | | select * from xzx_jhy_order |
| | | where status not in (1, 2, 5) and user_id=#{userId} |
| | | </select> |
| | | |
| | | <select id="selectInviteUserOrderList" resultType="com.xzx.gc.order.vo.InviteUserOrderVo"> |
| | | select |
| | | c.order_no orderNo, |
| | | from_base64(b.nick_name) username, |
| | | b.mobile_phone phone, |
| | | c.username orderName, |
| | | c.phone orderPhone, |
| | | concat(c.reserve_date, ' ', c.reserve_time) time, |
| | | concat(area, address) address, |
| | | group_concat(d.title) recycleType, |
| | | c.status status, |
| | | sum(d.score) score |
| | | from xzx_user_share_info a |
| | | inner join xzx_user_info b on a.register_mobile_phone=b.mobile_phone |
| | | inner join xzx_jhy_order c on b.user_id=c.user_id |
| | | inner join xzx_jhy_order_items d on c.id=d.order_id |
| | | where register_mobile_phone=#{record.phone} |
| | | group by c.order_no |
| | | </select> |
| | | </mapper> |
| | |
| | | select * from xzx_order_info |
| | | where order_status not in ('1', '2', '6') and create_user_id=#{userId} |
| | | </select> |
| | | |
| | | <select id="selectInviteUserOrderList" resultType="com.xzx.gc.order.vo.InviteUserOrderVo"> |
| | | select |
| | | a.order_id orderNo, |
| | | a.username, |
| | | a.mobile_phone phone, |
| | | a.rela_name orderName, |
| | | a.rela_phone orderPhone, |
| | | a.reserve_time time, |
| | | a.address, |
| | | a.order_status status, |
| | | group_concat(a.title) recycleType, |
| | | sum(a.money) coin |
| | | from ( |
| | | select c.order_id, b.mobile_phone, from_base64(b.nick_name) username, c.order_status, c.reserve_time, c.rela_name, c.rela_phone, concat(address_area, address, house_name, house_number, unit_name) address, d.money, e.title |
| | | from xzx_user_share_info a |
| | | inner join xzx_user_info b on a.register_mobile_phone=b.mobile_phone |
| | | inner join xzx_order_info c on b.user_id=c.create_user_id |
| | | left join xzx_order_item_info d on c.order_id=d.order_id and d.weight!='0.0' |
| | | left join xzx_sys_environmental_info e on d.item_type=e.item_type |
| | | where a.mobile_phone=#{record.phone} |
| | | group by c.order_id,c.create_time, d.item_type |
| | | order by c.create_time desc |
| | | ) a |
| | | group by a.order_id |
| | | </select> |
| | | |
| | | <select id="selectOrderWithWaitAndIng" resultType="com.xzx.gc.entity.OrderInfo"> |
| | | select * from xzx_order_info |
| | | where order_status in ('1', '2') and create_user_id=#{userId} |
| | | </select> |
| | | </mapper> |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class QueryJhyOrderListDto { |
| | |
| | | @ApiModelProperty(value="手机号") |
| | | private String accountPhone; |
| | | |
| | | @ApiModelProperty(value="排序字段 1:预约时间 2:名称") |
| | | private Integer namePx; |
| | | |
| | | @ApiModelProperty(value="排序方式 1: asc , 2 :aesc") |
| | | private Integer typePx; |
| | | |
| | | @ApiModelProperty(value="状态 1-待接单2-服务中3-已收款4-待入库5-已完成6-已取消") |
| | | private Integer status; |
| | | private List<Integer> status; |
| | | |
| | | @JsonFormat(shape=JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @ApiModelProperty(value="预约开始时间") |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class QueryOrderListDto { |
| | |
| | | @ApiModelProperty(value="客户姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value="排序字段 1:下单时间 2:客户名称") |
| | | private Integer namePx; |
| | | |
| | | @ApiModelProperty(value="排序方式 1: asc , 2 :aesc") |
| | | private Integer typePx; |
| | | |
| | | @ApiModelProperty(value="状态 1-待发货2-待收货3-已收货4-已完成5-已评价6-已取消") |
| | | private Integer status; |
| | | private List<Integer> status; |
| | | |
| | | @JsonFormat(shape=JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @ApiModelProperty(value="下单时间开始时间") |
| | |
| | | package com.xzx.gc.shop.mapper; |
| | | |
| | | import com.xzx.gc.entity.ScoreOrder; |
| | | import com.xzx.gc.shop.dto.QueryOrderListDto; |
| | | import com.xzx.gc.shop.dto.XcxOrderListDto; |
| | | import com.xzx.gc.shop.vo.QueryOrderListVo; |
| | | import com.xzx.gc.shop.vo.XcxOrderDetailsVo; |
| | |
| | | public interface ScoreOrderMapper extends GcMapper<ScoreOrder> { |
| | | |
| | | List<QueryOrderListVo> queryOrderList(@Param("name")String name, |
| | | @Param("accountName")String accountName, |
| | | @Param("orderNo")String orderNo, |
| | | @Param("status")Integer status, |
| | | @Param("status") List status, |
| | | @Param("createdTimeStart")Date createdTimeStart, |
| | | @Param("createdTimeEnd")Date createdTimeEnd); |
| | | @Param("createdTimeEnd")Date createdTimeEnd, |
| | | @Param("namePx")Integer namePx, |
| | | @Param("typePx")Integer typePx); |
| | | |
| | | List<XcxOrderListVo> selectXcxOrderList(@Param("record") XcxOrderListDto xcxOrderListDto); |
| | | |
| | |
| | | Map<String, Object> selectOrderStastics(@Param("userId") String userId); |
| | | |
| | | Integer selectScoreOrderCnt(@Param("userId") String userId); |
| | | |
| | | } |
| | |
| | | String name = model.getAccount(); |
| | | model.setAccount(name); |
| | | model.setAccountPhone(accountPhone); |
| | | List<Integer> status = new ArrayList<>(); |
| | | if(CollUtil.isEmpty(model.getStatus())){ |
| | | status.add(1); |
| | | status.add(2); |
| | | status.add(3); |
| | | status.add(4); |
| | | status.add(5); |
| | | status.add(6); |
| | | model.setStatus(status); |
| | | } |
| | | |
| | | List<QueryJhyOrderListVo> maps = jhyOrderMapper.queryOrderList(model); |
| | | if(CollUtil.isNotEmpty(maps)){ |
| | | for(QueryJhyOrderListVo queryJhyOrderListVo : maps){ |
| | |
| | | private IdUtils idUtils; |
| | | |
| | | public Map<String, Object> queryOrderList(QueryOrderListDto model) { |
| | | String accountName = model.getName(); |
| | | String name = StrUtil.isEmpty(model.getName())?model.getName():StringUtils.encode(model.getName()); |
| | | String orderNo = model.getOrderNo(); |
| | | Integer status = model.getStatus() == null ? 0 : model.getStatus(); |
| | | List<Integer> status = new ArrayList<>(); |
| | | if(CollUtil.isNotEmpty(model.getStatus())){ |
| | | status = model.getStatus(); |
| | | } |
| | | if(CollUtil.isEmpty(model.getStatus())){ |
| | | status.add(1); |
| | | status.add(2); |
| | | status.add(3); |
| | | status.add(4); |
| | | status.add(5); |
| | | status.add(6); |
| | | } |
| | | Date createdTimeStart = model.getCreatedTimeStart(); |
| | | Date createdTimeEnd = model.getCreatedTimeEnd(); |
| | | PageHelper.startPage(model.getPage(), model.getLimit()); |
| | | List<QueryOrderListVo> maps = scoreOrderMapper.queryOrderList(name,orderNo,status,createdTimeStart,createdTimeEnd); |
| | | Integer namePx = model.getNamePx() == null ? 2 : model.getNamePx(); |
| | | Integer typePx = model.getTypePx() == null ? 2 : model.getTypePx(); |
| | | List<QueryOrderListVo> maps = scoreOrderMapper.queryOrderList(name,accountName,orderNo,status,createdTimeStart,createdTimeEnd,namePx,typePx); |
| | | if(CollUtil.isNotEmpty(maps)){ |
| | | for(QueryOrderListVo queryOrderListVo : maps){ |
| | | String decode = StringUtils.decode(queryOrderListVo.getName()); |
| | |
| | | <if test="record.orderNo != null and record.orderNo != ''"> |
| | | and a.order_no like concat('%',#{record.orderNo},'%') |
| | | </if> |
| | | <if test="record.status != null and record.status != ''"> |
| | | and a.status = #{record.status} |
| | | <if test="record.status.size > 0"> |
| | | and a.status in |
| | | <foreach collection="record.status" item="sta" open="(" separator="," close=")"> |
| | | #{sta} |
| | | </foreach> |
| | | </if> |
| | | <if test="record.jwyName != null and record.jwyName != ''"> |
| | | and d.username like concat('%',#{record.jwyName},'%') |
| | | and (d.username like concat('%',#{record.jwyName},'%') |
| | | or d.mobile like concat('%',#{record.jwyName},'%')) |
| | | </if> |
| | | <if test="record.account != null and record.account != ''"> |
| | | and ( a.username like concat('%',#{record.account},'%') |
| | |
| | | <if test="record.reserveTimeEnd != null"> |
| | | and a.reserve_date <= #{record.reserveTimeEnd} |
| | | </if> |
| | | order by a.CREATED_TIME desc |
| | | order by |
| | | <if test="record.namePx != null and record.namePx != '' and record.namePx == 1"> |
| | | a.CREATED_TIME |
| | | </if> |
| | | <if test="record.namePx != null and record.namePx != '' and record.namePx == 2"> |
| | | a.username |
| | | </if> |
| | | |
| | | <if test="record.typePx != null and record.typePx != '' and record.typePx == 1"> |
| | | asc |
| | | </if> |
| | | <if test="record.typePx != null and record.typePx != '' and record.typePx == 2"> |
| | | desc |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | |
| | | </if> |
| | | |
| | | <if test="name != null and name != ''"> |
| | | and b.nick_name like concat('%',#{name},'%') |
| | | and (b.nick_name like concat('%',#{name},'%') |
| | | or b.mobile_phone like concat('%',#{accountName},'%') ) |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | and a.status = #{status} |
| | | <if test="status.size > 0"> |
| | | and a.status in |
| | | <foreach collection="status" item="sta" open="(" separator="," close=")"> |
| | | #{sta} |
| | | </foreach> |
| | | </if> |
| | | <if test="createdTimeStart != null"> |
| | | and a.CREATED_TIME >= #{createdTimeStart} |
| | |
| | | <if test="createdTimeEnd != null"> |
| | | and a.CREATED_TIME <= #{createdTimeEnd} |
| | | </if> |
| | | order by a.CREATED_TIME desc |
| | | order by |
| | | <if test="namePx != null and namePx != '' and namePx == 1"> |
| | | a.CREATED_TIME |
| | | </if> |
| | | <if test="namePx != null and namePx != '' and namePx == 2"> |
| | | from_base64(b.nick_name) |
| | | </if> |
| | | |
| | | <if test="typePx != null and typePx != '' and typePx == 1"> |
| | | asc |
| | | </if> |
| | | <if test="typePx != null and typePx != '' and typePx == 2"> |
| | | desc |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <select id="selectXcxOrderList" resultType="com.xzx.gc.shop.vo.XcxOrderListVo"> |
| | |
| | | MODIFY COLUMN `rule_type` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '规则类型:1:红包规则,2:分享分利规则 3阶梯 4推广 5重量返利 7提成 8提佣 9积分规则 10邀请奖励规则' AFTER `share_ratio`; |
| | | |
| | | |
| | | |
| | | CREATE TABLE `xzx_sys_popup` ( |
| | | `id` bigint(20) NOT NULL AUTO_INCREMENT, |
| | | `area` int(11) DEFAULT NULL COMMENT '广告区域 1:首页2:其他', |
| | | `name` varchar(100) DEFAULT NULL COMMENT '广告名称', |
| | | `aims` int(11) DEFAULT NULL COMMENT '弹窗人群:1:新用戶 2:老用戶', |
| | | `rules` int(11) DEFAULT NULL COMMENT '弹窗规则:1:每日首次登录 2:每次登录', |
| | | `is_out` int(11) DEFAULT NULL COMMENT '是否跳转 1:是 2:否', |
| | | `out_text` varchar(500) DEFAULT NULL COMMENT '内容链接', |
| | | `start_time` varchar(100) DEFAULT NULL COMMENT '开始日期', |
| | | `end_time` varchar(100) DEFAULT NULL COMMENT '结束日期', |
| | | `img` varchar(500) DEFAULT NULL COMMENT '上传图片', |
| | | `state` int(11) DEFAULT NULL COMMENT '是否上架 1:是2:否', |
| | | PRIMARY KEY (`id`) |
| | | ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='首页弹窗表'; |
| | | |
| | | |
| | | |
| | |
| | | package com.xzx.gc.system.controller; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.xzx.gc.common.constant.CommonEnum; |
| | | import com.xzx.gc.common.constant.Constants; |
| | | import com.xzx.gc.common.dto.log.OperationAppLog; |
| | | import com.xzx.gc.common.request.BaseController; |
| | | import com.xzx.gc.entity.BannerInfo; |
| | | import com.xzx.gc.entity.SysPopup; |
| | | import com.xzx.gc.model.JsonResult; |
| | | import com.xzx.gc.system.dto.*; |
| | | import com.xzx.gc.system.mapper.BannerMapper; |
| | | import com.xzx.gc.system.service.BannerService; |
| | | import com.xzx.gc.system.vo.SysBannerListVo; |
| | | import com.xzx.gc.system.vo.SysPopupListVo; |
| | | import com.xzx.gc.system.vo.ViewSysBannerVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | |
| | | @Resource |
| | | BannerMapper bannerMapper; |
| | | |
| | | @ApiOperation(value = "首页弹窗--列表") |
| | | @ApiResponses( |
| | | @ApiResponse(code = 200, message = "success", response = SysPopupListVo.class) |
| | | ) |
| | | @PostMapping(value = Constants.ADMIN_VIEW_PREFIX + "/sysPopup/sysPopupList.json") |
| | | public JsonResult<Map<String, Object>> sysPopupList(@RequestBody SysPopupListDto sysPopupListDto) { |
| | | return JsonResult.success(bannerService.sysPopupList(sysPopupListDto)); |
| | | } |
| | | |
| | | @PostMapping(Constants.ADMIN_VIEW_PREFIX+"/sysPopup/addSysPopup.json") |
| | | @ApiOperation(value = "首页弹窗--添加", notes = "test: 仅0有正确返回") |
| | | public JsonResult<String> addSysPopup(@RequestBody AddSysPopupDto model, HttpServletRequest request) { |
| | | bannerService.addSysPopup(model); |
| | | OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) |
| | | .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("首页弹窗--添加-").build(); |
| | | mqUtil.sendApp(build); |
| | | return JsonResult.success("操作成功!"); |
| | | } |
| | | |
| | | @PostMapping(Constants.ADMIN_VIEW_PREFIX + "/sysPopup/viewSysPopup.json") |
| | | @ApiResponses({@ApiResponse( code = 200, message = "success", response = SysPopupListVo.class)}) |
| | | @ApiOperation(value="首页弹窗--查看详情", notes="test: 仅0有正确返回") |
| | | public JsonResult<SysPopupListVo> viewSysPopup(@RequestBody ViewSysPopupDto viewSysPopupDto) { |
| | | Long id = viewSysPopupDto.getId(); |
| | | SysPopupListVo sysPopupListVo = bannerMapper.selectSysPopupById(id); |
| | | return JsonResult.success(sysPopupListVo); |
| | | } |
| | | |
| | | @PostMapping(Constants.ADMIN_VIEW_PREFIX + "/sysPopup/updateSysPopup.json") |
| | | @ApiOperation(value="首页弹窗--更新详情", notes="test: 仅0有正确返回") |
| | | public JsonResult updateSysPopup(@RequestBody UpdateSysPopupDto model, HttpServletRequest request) { |
| | | long id = model.getId(); |
| | | SysPopupListVo sysPopupListVo = bannerMapper.selectSysPopupById(id); |
| | | if(ObjectUtil.isEmpty(sysPopupListVo)){ |
| | | return JsonResult.failMessage("当前记录不存在!"); |
| | | } |
| | | bannerService.updateSysPopup(model); |
| | | OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) |
| | | .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("首页弹窗--更新详情-" + id).build(); |
| | | mqUtil.sendApp(build); |
| | | return JsonResult.success("操作成功!"); |
| | | } |
| | | |
| | | @PostMapping(Constants.ADMIN_VIEW_PREFIX + "/sysPopup/delSysPopup.json") |
| | | @ApiOperation(value="首页弹窗--删除", notes="test: 仅0有正确返回") |
| | | public JsonResult delSysPopup(@RequestBody DelSysPopupDto model, HttpServletRequest request) { |
| | | long id = model.getId(); |
| | | SysPopupListVo sysPopupListVo = bannerMapper.selectSysPopupById(id); |
| | | if(ObjectUtil.isEmpty(sysPopupListVo)){ |
| | | return JsonResult.failMessage("当前记录不存在!"); |
| | | } |
| | | bannerService.delSysPopup(model); |
| | | OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) |
| | | .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("首页弹窗--删除-" + id).build(); |
| | | mqUtil.sendApp(build); |
| | | return JsonResult.success("操作成功!"); |
| | | } |
| | | |
| | | @PostMapping(Constants.ADMIN_VIEW_PREFIX + "/sysPopup/onOffSysPopup.json") |
| | | @ApiOperation(value="首页弹窗--上下架", notes="test: 仅0有正确返回") |
| | | public JsonResult onOffSysPopup(@RequestBody OnSysPopupDto model, HttpServletRequest request) { |
| | | long id = model.getId(); |
| | | SysPopupListVo sysPopupListVo = bannerMapper.selectSysPopupById(id); |
| | | if(ObjectUtil.isEmpty(sysPopupListVo)){ |
| | | return JsonResult.failMessage("当前记录不存在!"); |
| | | } |
| | | Integer state = model.getStatus(); |
| | | String startTime = sysPopupListVo.getStartTime(); |
| | | String endTime = sysPopupListVo.getEndTime(); |
| | | |
| | | DateTime dateTime = DateUtil.parseDate(endTime); |
| | | int compare = DateUtil.compare(DateUtil.date(), dateTime); |
| | | if(1 == state && compare > 0){ |
| | | return JsonResult.failMessage("首页弹窗已过期!"); |
| | | } |
| | | List<SysPopup> sysPopups = bannerMapper.selectSysPopupBystate(1,startTime,endTime); |
| | | if(1 == state && CollUtil.isNotEmpty(sysPopups)){ |
| | | return JsonResult.failMessage("当前时间段已有上架首页弹窗!"); |
| | | } |
| | | bannerService.onOffSysPopup(model); |
| | | OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) |
| | | .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("首页弹窗--上下架-" + id).build(); |
| | | mqUtil.sendApp(build); |
| | | return JsonResult.success("操作成功!"); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "轮播图--列表") |
| | | @ApiResponses( |
| | | @ApiResponse(code = 200, message = "success", response = SysBannerListVo.class) |
| | |
| | | import com.xzx.gc.system.dto.ApiBannerListDto; |
| | | import com.xzx.gc.system.dto.ApiNewsInfoDto; |
| | | import com.xzx.gc.system.dto.ApiNewsListDto; |
| | | import com.xzx.gc.system.dto.ApiSysPopupDto; |
| | | import com.xzx.gc.system.service.BannerService; |
| | | import com.xzx.gc.system.service.SysNewsService; |
| | | import com.xzx.gc.system.vo.ApiBannerListVo; |
| | | import com.xzx.gc.system.vo.ApiNewsInfoVo; |
| | | import com.xzx.gc.system.vo.ApiNewsListVo; |
| | | import com.xzx.gc.system.vo.SysBannerListVo; |
| | | import com.xzx.gc.system.vo.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | |
| | | apiNewsInfoDto.setUserId(getUserId(request)); |
| | | return JsonResult.success(sysNewsService.newsInfo(apiNewsInfoDto)); |
| | | } |
| | | |
| | | @ApiOperation("首页弹窗详情") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiSysPopupVo.class) |
| | | }) |
| | | @PostMapping(value = "/news/sysPopupInfo") |
| | | public JsonResult<ApiSysPopupVo> sysPopupInfo(@RequestBody ApiSysPopupDto apiSysPopupDto, HttpServletRequest request) { |
| | | apiSysPopupDto.setUserId(getUserId(request)); |
| | | return JsonResult.success(sysNewsService.sysPopupInfo(apiSysPopupDto)); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.xzx.gc.system.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AddSysPopupDto { |
| | | |
| | | //广告区域 |
| | | @ApiModelProperty(value = "广告区域") |
| | | private Integer area; |
| | | |
| | | //广告名称 |
| | | @ApiModelProperty(value = "广告名称") |
| | | private String name; |
| | | |
| | | //弹窗人群:1:新用戶 2:老用戶 |
| | | @ApiModelProperty(value = "弹窗人群:1:新用戶 2:老用戶") |
| | | private Integer aims; |
| | | |
| | | //弹窗规则:1:每日首次登录 2:每次登录 |
| | | @ApiModelProperty(value = "弹窗规则:1:每日首次登录 2:每次登录") |
| | | private Integer rules; |
| | | |
| | | //是否跳转 1:是 2:否 |
| | | @ApiModelProperty(value = "是否跳转 1:是 2:否") |
| | | private Integer isOut; |
| | | |
| | | //内容链接 |
| | | @ApiModelProperty(value = "内容链接") |
| | | private String outText; |
| | | |
| | | //开始日期 |
| | | @ApiModelProperty(value = "开始日期") |
| | | private String startTime; |
| | | |
| | | //结束日期 |
| | | @ApiModelProperty(value = "结束日期") |
| | | private String endTime; |
| | | |
| | | //上传图片 |
| | | @ApiModelProperty(value = "上传图片") |
| | | private String img; |
| | | |
| | | //是否上架 1:是2:否 |
| | | @ApiModelProperty(value = "是否上架 1:是2:否") |
| | | private Integer state; |
| | | } |
| New file |
| | |
| | | package com.xzx.gc.system.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ApiSysPopupDto { |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private String userId; |
| | | } |
| New file |
| | |
| | | package com.xzx.gc.system.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DelSysPopupDto { |
| | | @ApiModelProperty(value = "Id") |
| | | private long id; |
| | | } |
| New file |
| | |
| | | package com.xzx.gc.system.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class OnSysPopupDto { |
| | | |
| | | @ApiModelProperty(value = "Id") |
| | | private long id; |
| | | |
| | | @ApiModelProperty(value = "状态 1:未发布 2:已发布") |
| | | private Integer status; |
| | | } |
| New file |
| | |
| | | package com.xzx.gc.system.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SysPopupListDto { |
| | | |
| | | @ApiModelProperty(value = "第几页", required = true) |
| | | private int page; |
| | | |
| | | @ApiModelProperty(value = "每一页数量", required = true) |
| | | private int limit; |
| | | } |
| New file |
| | |
| | | package com.xzx.gc.system.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class UpdateSysPopupDto { |
| | | |
| | | |
| | | @ApiModelProperty(value = "Id") |
| | | private Long id; |
| | | |
| | | //广告区域 |
| | | @ApiModelProperty(value = "广告区域") |
| | | private Integer area; |
| | | |
| | | //广告名称 |
| | | @ApiModelProperty(value = "广告名称") |
| | | private String name; |
| | | |
| | | //弹窗人群:1:新用戶 2:老用戶 |
| | | @ApiModelProperty(value = "弹窗人群:1:新用戶 2:老用戶") |
| | | private Integer aims; |
| | | |
| | | //弹窗规则:1:每日首次登录 2:每次登录 |
| | | @ApiModelProperty(value = "弹窗规则:1:每日首次登录 2:每次登录") |
| | | private Integer rules; |
| | | |
| | | //是否跳转 1:是 2:否 |
| | | @ApiModelProperty(value = "是否跳转 1:是 2:否") |
| | | private Integer isOut; |
| | | |
| | | //内容链接 |
| | | @ApiModelProperty(value = "内容链接") |
| | | private String outText; |
| | | |
| | | //开始日期 |
| | | @ApiModelProperty(value = "开始日期") |
| | | private String startTime; |
| | | |
| | | //结束日期 |
| | | @ApiModelProperty(value = "结束日期") |
| | | private String endTime; |
| | | |
| | | //上传图片 |
| | | @ApiModelProperty(value = "上传图片") |
| | | private String img; |
| | | |
| | | //是否上架 1:是2:否 |
| | | @ApiModelProperty(value = "是否上架 1:是2:否") |
| | | private Integer state; |
| | | } |
| New file |
| | |
| | | package com.xzx.gc.system.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ViewSysPopupDto { |
| | | private Long id; |
| | | } |
| | |
| | | package com.xzx.gc.system.mapper; |
| | | |
| | | import com.xzx.gc.entity.BannerInfo; |
| | | import com.xzx.gc.entity.SysPopup; |
| | | import com.xzx.gc.model.admin.BannerModel; |
| | | import com.xzx.gc.model.system.ConfigInfoVo; |
| | | import com.xzx.gc.system.dto.SysBannerListDto; |
| | | import com.xzx.gc.system.dto.SysPopupListDto; |
| | | import com.xzx.gc.system.vo.ApiBannerListVo; |
| | | import com.xzx.gc.system.vo.SysBannerListVo; |
| | | import com.xzx.gc.system.vo.SysPopupListVo; |
| | | import com.xzx.gc.system.vo.ViewSysBannerVo; |
| | | import com.xzx.gc.util.GcMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | void updateStatusById(@Param("id")long id, @Param("status")Integer status); |
| | | |
| | | List<ApiBannerListVo> selectBannerList(); |
| | | |
| | | List<SysPopupListVo> selectSysPopup(SysPopupListDto sysPopupListDto); |
| | | |
| | | SysPopupListVo selectSysPopupById(@Param("id")Long id); |
| | | |
| | | void updateSysPopupById(@Param("id")Long id,@Param("area")Integer area, @Param("name")String name, @Param("aims")Integer aims, |
| | | @Param("rules")Integer rules, @Param("isOut")Integer isOut, @Param("outText")String outText, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime, @Param("img")String img); |
| | | |
| | | void updateSysPopupStatusById(@Param("id")long id, @Param("state")Integer state); |
| | | |
| | | List<SysPopup> selectSysPopupBystate(@Param("state")int i,@Param("startTime")String startTime,@Param("endTime")String endTime); |
| | | } |
| | | |
| | |
| | | import com.xzx.gc.system.dto.SysNewsListDto; |
| | | import com.xzx.gc.system.vo.ApiNewsInfoVo; |
| | | import com.xzx.gc.system.vo.ApiNewsListVo; |
| | | import com.xzx.gc.system.vo.ApiSysPopupVo; |
| | | import com.xzx.gc.system.vo.SysNewsListVo; |
| | | import com.xzx.gc.util.GcMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | List<ApiNewsListVo> selectSysNews(); |
| | | |
| | | ApiNewsInfoVo selectSysNewsInfo(@Param("record")ApiNewsInfoDto apiNewsInfoDto); |
| | | |
| | | ApiSysPopupVo selectSysPopupInfo(@Param("format")String format); |
| | | } |
| New file |
| | |
| | | package com.xzx.gc.system.mapper; |
| | | |
| | | import com.xzx.gc.entity.SysPopup; |
| | | import com.xzx.gc.system.vo.SysPopupListVo; |
| | | import com.xzx.gc.util.GcMapper; |
| | | |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Repository |
| | | public interface SysPopupMapper extends GcMapper<SysPopup> { |
| | | } |
| | |
| | | import com.xzx.gc.entity.BannerInfo;
|
| | | import com.xzx.gc.entity.CityPartner;
|
| | | import com.xzx.gc.entity.CoreUser;
|
| | | import com.xzx.gc.entity.SysPopup;
|
| | | import com.xzx.gc.model.JsonResult;
|
| | | import com.xzx.gc.model.admin.BannerModel;
|
| | | import com.xzx.gc.system.dto.*;
|
| | | import com.xzx.gc.system.mapper.BannerMapper;
|
| | | import com.xzx.gc.system.vo.ApiBannerListVo;
|
| | | import com.xzx.gc.system.vo.SysBannerListVo;
|
| | | import com.xzx.gc.system.vo.SysNewsListVo;
|
| | | import com.xzx.gc.system.vo.ViewSysBannerVo;
|
| | | import com.xzx.gc.system.mapper.SysPopupMapper;
|
| | | import com.xzx.gc.system.vo.*;
|
| | | import com.xzx.gc.util.SessionUtil;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | |
| | |
|
| | | @Autowired
|
| | | private BannerMapper bannerMapper;
|
| | |
|
| | | @Autowired
|
| | | private SysPopupMapper sysPopupMapper;
|
| | |
|
| | | @Autowired
|
| | | private SessionUtil sessionUtil;
|
| | |
| | | public List<ApiBannerListVo> bannerList(ApiBannerListDto apiBannerListDto) {
|
| | | return bannerMapper.selectBannerList();
|
| | | }
|
| | |
|
| | | public Map<String, Object> sysPopupList(SysPopupListDto sysPopupListDto) {
|
| | | PageHelper.startPage(sysPopupListDto.getPage(), sysPopupListDto.getLimit());
|
| | | List<SysPopupListVo> sysPopupListVos = bannerMapper.selectSysPopup(sysPopupListDto);
|
| | | PageInfo<SysPopupListVo> pageInfo = new PageInfo<>(sysPopupListVos);
|
| | |
|
| | | Map<String, Object> data = new HashMap<>();
|
| | | int count = Convert.toInt(pageInfo.getTotal());
|
| | | data.put("data", sysPopupListVos);
|
| | | data.put("count", count);
|
| | | data.put("code", 0);
|
| | | return data;
|
| | | }
|
| | |
|
| | |
|
| | | public void addSysPopup(AddSysPopupDto model) {
|
| | | SysPopup sysPopup = new SysPopup();
|
| | | sysPopup.setArea(model.getArea());
|
| | | sysPopup.setName(model.getName());
|
| | | sysPopup.setAims(model.getAims());
|
| | | sysPopup.setRules(model.getRules());
|
| | | sysPopup.setIsOut(model.getIsOut());
|
| | | sysPopup.setOutText(model.getOutText());
|
| | | sysPopup.setStartTime(model.getStartTime());
|
| | | sysPopup.setEndTime(model.getEndTime());
|
| | | sysPopup.setImg(model.getImg());
|
| | | sysPopup.setState(2);
|
| | | sysPopupMapper.insertSelective(sysPopup);
|
| | | }
|
| | |
|
| | | public SysPopupListVo viewSysPopup(Long id) {
|
| | | return bannerMapper.selectSysPopupById(id);
|
| | | }
|
| | |
|
| | | public void updateSysPopup(UpdateSysPopupDto model) {
|
| | | bannerMapper.updateSysPopupById(
|
| | | model.getId(),
|
| | | model.getArea(),
|
| | | model.getName(),
|
| | | model.getAims(),
|
| | | model.getRules(),
|
| | | model.getIsOut(),
|
| | | model.getOutText(),
|
| | | model.getStartTime(),
|
| | | model.getEndTime(),
|
| | | model.getImg()
|
| | | );
|
| | | }
|
| | |
|
| | | public void delSysPopup(DelSysPopupDto model) {
|
| | | sysPopupMapper.deleteByPrimaryKey(model.getId());
|
| | | }
|
| | |
|
| | | public void onOffSysPopup(OnSysPopupDto model) {
|
| | | bannerMapper.updateSysPopupStatusById(model.getId(),model.getStatus());
|
| | | }
|
| | | }
|
| | |
| | | import com.xzx.gc.entity.SysNews; |
| | | import com.xzx.gc.system.dto.*; |
| | | import com.xzx.gc.system.mapper.SysNewsMapper; |
| | | import com.xzx.gc.system.vo.ApiNewsInfoVo; |
| | | import com.xzx.gc.system.vo.ApiNewsListVo; |
| | | import com.xzx.gc.system.vo.SysNewsListVo; |
| | | import com.xzx.gc.system.vo.ViewSysNewsVo; |
| | | import com.xzx.gc.system.vo.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | public ApiNewsInfoVo newsInfo(ApiNewsInfoDto apiNewsInfoDto) { |
| | | return sysNewsMapper.selectSysNewsInfo(apiNewsInfoDto); |
| | | } |
| | | |
| | | public ApiSysPopupVo sysPopupInfo(ApiSysPopupDto apiSysPopupDto) { |
| | | String format = DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"); |
| | | return sysNewsMapper.selectSysPopupInfo(format); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.xzx.gc.system.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiSysPopupVo", description = "返回参数类") |
| | | public class ApiSysPopupVo { |
| | | |
| | | //广告区域 |
| | | @ApiModelProperty(value = "广告区域") |
| | | private Integer area; |
| | | |
| | | //广告名称 |
| | | @ApiModelProperty(value = "广告名称") |
| | | private String name; |
| | | |
| | | //弹窗人群:1:新用戶 2:老用戶 |
| | | @ApiModelProperty(value = "弹窗人群:1:新用戶 2:老用戶") |
| | | private Integer aims; |
| | | |
| | | //弹窗规则:1:每日首次登录 2:每次登录 |
| | | @ApiModelProperty(value = "弹窗规则:1:每日首次登录 2:每次登录") |
| | | private Integer rules; |
| | | |
| | | //是否跳转 1:是 2:否 |
| | | @ApiModelProperty(value = "是否跳转 1:是 2:否") |
| | | private Integer isOut; |
| | | |
| | | //内容链接 |
| | | @ApiModelProperty(value = "内容链接") |
| | | private String outText; |
| | | |
| | | //开始日期 |
| | | @ApiModelProperty(value = "开始日期") |
| | | private String startTime; |
| | | |
| | | //结束日期 |
| | | @ApiModelProperty(value = "结束日期") |
| | | private String endTime; |
| | | |
| | | //上传图片 |
| | | @ApiModelProperty(value = "上传图片") |
| | | private String img; |
| | | |
| | | //是否上架 1:是2:否 |
| | | @ApiModelProperty(value = "是否上架 1:是2:否") |
| | | private Integer state; |
| | | } |
| New file |
| | |
| | | package com.xzx.gc.system.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SysPopupListVo", description = "返回参数类") |
| | | public class SysPopupListVo { |
| | | |
| | | |
| | | @ApiModelProperty(value = "Id") |
| | | private Long id; |
| | | |
| | | //广告区域 |
| | | @ApiModelProperty(value = "广告区域") |
| | | private Integer area; |
| | | |
| | | //广告名称 |
| | | @ApiModelProperty(value = "广告名称") |
| | | private String name; |
| | | |
| | | //弹窗人群:1:新用戶 2:老用戶 |
| | | @ApiModelProperty(value = "弹窗人群:1:新用戶 2:老用戶") |
| | | private Integer aims; |
| | | |
| | | //弹窗规则:1:每日首次登录 2:每次登录 |
| | | @ApiModelProperty(value = "弹窗规则:1:每日首次登录 2:每次登录") |
| | | private Integer rules; |
| | | |
| | | //是否跳转 1:是 2:否 |
| | | @ApiModelProperty(value = "是否跳转 1:是 2:否") |
| | | private Integer isOut; |
| | | |
| | | //内容链接 |
| | | @ApiModelProperty(value = "内容链接") |
| | | private String outText; |
| | | |
| | | //开始日期 |
| | | @ApiModelProperty(value = "开始日期") |
| | | private String startTime; |
| | | |
| | | //结束日期 |
| | | @ApiModelProperty(value = "结束日期") |
| | | private String endTime; |
| | | |
| | | //上传图片 |
| | | @ApiModelProperty(value = "上传图片") |
| | | private String img; |
| | | |
| | | //是否上架 1:是2:否 |
| | | @ApiModelProperty(value = "是否上架 1:是2:否") |
| | | private Integer state; |
| | | } |
| | |
| | | where del_flag = 0 and status = 2
|
| | | order by sort ASC
|
| | | </select>
|
| | |
|
| | | <select id="selectSysPopup" resultType="com.xzx.gc.system.vo.SysPopupListVo">
|
| | | select * from xzx_sys_popup
|
| | | order by id desc
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="selectSysPopupById" resultType="com.xzx.gc.system.vo.SysPopupListVo">
|
| | | select * from xzx_sys_popup where id = #{id}
|
| | | </select>
|
| | |
|
| | |
|
| | |
|
| | | <update id="updateSysPopupById" parameterType="java.util.Map">
|
| | | update xzx_sys_popup
|
| | | set area = #{area},
|
| | | name = #{name},
|
| | | aims = #{aims},
|
| | | rules = #{rules},
|
| | | is_out = #{isOut},
|
| | | out_text = #{outText},
|
| | | start_time = #{startTime},
|
| | | end_time = #{endTime},
|
| | | img = #{img}
|
| | | where id = #{id}
|
| | | </update>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | <update id="updateSysPopupStatusById" parameterType="java.util.Map">
|
| | | update xzx_sys_popup
|
| | | set state = #{state}
|
| | | where id = #{id}
|
| | | </update>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | <select id="selectSysPopupBystate" resultType="com.xzx.gc.entity.SysPopup">
|
| | | select * from xzx_sys_popup where state = #{state}
|
| | | and ((#{startTime} >= start_time and #{startTime} <= end_time)
|
| | | or (#{endTime} >= start_time and #{endTime} <= end_time)
|
| | | or (#{startTime} <= start_time and #{endTime} >= end_time))
|
| | | </select>
|
| | | </mapper> |
| | |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="selectSysPopupInfo" resultType="com.xzx.gc.system.vo.ApiSysPopupVo"> |
| | | select * from xzx_sys_popup |
| | | where end_time >= #{format} |
| | | and start_time <= #{format} |
| | | and state = 1 |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| 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="com.xzx.gc.system.mapper.SysPopupMapper"> |
| | | |
| | | </mapper> |
| | |
| | | import com.xzx.gc.user.dto.*; |
| | | import com.xzx.gc.user.mapper.*; |
| | | import com.xzx.gc.user.service.*; |
| | | import com.xzx.gc.user.vo.JhyInfoListVo; |
| | | import com.xzx.gc.user.vo.TgmxInfoListVo; |
| | | import com.xzx.gc.user.vo.UserIdentityVo; |
| | | import com.xzx.gc.util.DoubleUtil; |
| | | import com.xzx.gc.util.SessionUtil; |
| | |
| | | return Result.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "推广明细列表") |
| | | @ApiResponses( |
| | | @ApiResponse(code = 200, message = "success", response = TgmxInfoListVo.class) |
| | | ) |
| | | @PostMapping(value = Constants.ADMIN_VIEW_PREFIX + "/user/tgmxInfo.json") |
| | | public JsonResult<Map<String, Object>> tgmxInfo(@RequestBody TgmxInfoListDto tgmxInfoListDto) { |
| | | return JsonResult.success(userService.tgmxInfo(tgmxInfoListDto)); |
| | | } |
| | | |
| | | } |
| | | |
| New file |
| | |
| | | package com.xzx.gc.user.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class TgmxInfoListDto { |
| | | |
| | | @ApiModelProperty("邀请用户名称") |
| | | private String yqrName; |
| | | |
| | | @ApiModelProperty("注册用户名称") |
| | | private String zcName; |
| | | |
| | | @ApiModelProperty("邀请用户/注册用户手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value="第几页",required=true) |
| | | private int page; |
| | | |
| | | @ApiModelProperty(value="每一页数量",required=true) |
| | | private int limit; |
| | | |
| | | } |
| | |
| | | import com.xzx.gc.entity.UserInfo; |
| | | import com.xzx.gc.model.admin.UserModel; |
| | | import com.xzx.gc.model.user.*; |
| | | import com.xzx.gc.user.dto.TgmxInfoListDto; |
| | | import com.xzx.gc.user.vo.TgmxInfoListVo; |
| | | import com.xzx.gc.util.GcMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | List<UserModel> queryAllUserByPid(@Param("userName") String userName, @Param("roleType") String roleType, @Param("partnerId") String partnerId); |
| | | |
| | | UserModel queryUserById(@Param("userId") String userId); |
| | | |
| | | List<TgmxInfoListVo> tgmxInfo(@Param("record")TgmxInfoListDto model); |
| | | } |
| | |
| | | import com.xzx.gc.model.user.*; |
| | | import com.xzx.gc.user.dto.AddressDto; |
| | | import com.xzx.gc.user.dto.RayaltyDto; |
| | | import com.xzx.gc.user.dto.TgmxInfoListDto; |
| | | import com.xzx.gc.user.mapper.*; |
| | | import com.xzx.gc.user.vo.CategaryVo; |
| | | import com.xzx.gc.user.vo.TgmxInfoListVo; |
| | | import com.xzx.gc.user.vo.UserIdentityVo; |
| | | import com.xzx.gc.util.DoubleUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | userMapper.insertSelective(userInfo); |
| | | } |
| | | |
| | | public Map<String, Object> tgmxInfo(TgmxInfoListDto model) { |
| | | PageHelper.startPage(model.getPage(), model.getLimit()); |
| | | List<TgmxInfoListVo> maps = userMapper.tgmxInfo(model); |
| | | PageInfo pageInfo = new PageInfo(maps); |
| | | int count = Convert.toInt(pageInfo.getTotal()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", maps); |
| | | map.put("count", count); |
| | | map.put("code", 0); |
| | | return map; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.xzx.gc.user.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "TgmxInfoListVo", description = "返回参数类") |
| | | public class TgmxInfoListVo { |
| | | |
| | | @ApiModelProperty(value = "邀请人名称") |
| | | private String yqrName; |
| | | |
| | | @ApiModelProperty(value = "邀请人手机号") |
| | | private String yqrPhone; |
| | | |
| | | @ApiModelProperty(value = "注册用户名称") |
| | | private String zcName; |
| | | |
| | | @ApiModelProperty(value = "注册用户手机号") |
| | | private String zcPhone; |
| | | |
| | | @ApiModelProperty(value = "注册日期") |
| | | private String zcDate; |
| | | |
| | | } |
| | |
| | | and user_id=#{userId} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="tgmxInfo" resultType="com.xzx.gc.user.vo.TgmxInfoListVo"> |
| | | SELECT |
| | | a.mobile_phone yqrPhone, |
| | | from_base64(b.nick_name) yqrName, |
| | | from_base64(c.nick_name) zcName, |
| | | a.register_mobile_phone zcPhone, |
| | | a.register_time zcDate |
| | | FROM xzx_user_share_info a |
| | | LEFT JOIN xzx_user_info b ON a.mobile_phone=b.mobile_phone |
| | | LEFT JOIN xzx_user_info c ON a.register_mobile_phone=c.mobile_phone |
| | | <where> |
| | | 1=1 |
| | | <if test="record.yqrName != null and record.yqrName != ''"> |
| | | and from_base64(b.nick_name) like concat('%',#{record.yqrName},'%') |
| | | </if> |
| | | <if test="record.zcName != null and record.zcName != ''"> |
| | | and from_base64(c.nick_name) like concat('%',#{record.zcName},'%') |
| | | </if> |
| | | <if test="record.phone != null and record.phone != ''"> |
| | | and (a.register_mobile_phone like concat('%',#{record.phone},'%') |
| | | or a.mobile_phone like concat('%',#{record.phone},'%')) |
| | | </if> |
| | | </where> |
| | | order by a.register_time desc |
| | | </select> |
| | | </mapper> |