后管页面
This commit is contained in:
parent
08450fcf95
commit
fea3bd87e2
@ -134,7 +134,7 @@ public class CategoryController {
|
||||
@ApiOperation(value = "获取tree结构的列表")
|
||||
@RequestMapping(value = "/list/tree", method = RequestMethod.GET)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="type", value="类型ID | 类型,1 产品分类,2 附件分类,3 文章分类, 4 设置分类, 5 菜单分类, 6 配置分类, 7 秒杀配置, 8 套餐分类", example = "1"),
|
||||
@ApiImplicitParam(name="type", value="类型ID | 类型,1 产品分类,2 附件分类,3 文章分类, 4 设置分类, 5 菜单分类, 6 配置分类, 7 秒杀配置, 8 套餐分类,9 帮助分类", example = "1"),
|
||||
@ApiImplicitParam(name="status", value="-1=全部,0=未生效,1=已生效", example = "1"),
|
||||
@ApiImplicitParam(name="name", value="模糊搜索", example = "电视")
|
||||
})
|
||||
|
@ -0,0 +1,89 @@
|
||||
package com.zbkj.admin.controller;
|
||||
|
||||
import com.zbkj.common.model.deliveryset.DeliverySetTime;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.DeliveryTimeRequest;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.service.service.DeliverySetTimeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("api/admin/deliveryTime")
|
||||
@Api(tags = "送达时间设置")
|
||||
public class DeliverySetTimeController {
|
||||
|
||||
@Autowired DeliverySetTimeService deliverySetTimeService;
|
||||
|
||||
@PreAuthorize("hasAuthority('admin:deliveryTime:list')")
|
||||
@ApiOperation(value = "分页列表")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ApiImplicitParam(name="keywords", value="搜索关键字")
|
||||
public CommonResult<CommonPage<DeliverySetTime>> getList(@Validated DeliveryTimeRequest request, @Validated PageParamRequest pageParamRequest) {
|
||||
List<DeliverySetTime> list = deliverySetTimeService.getList(request, pageParamRequest);
|
||||
return CommonResult.success(CommonPage.restPage(list));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('admin:deliveryTime:save')")
|
||||
@ApiOperation(value = "新增")
|
||||
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
||||
public CommonResult<String> save(@RequestBody @Validated DeliveryTimeRequest request) {
|
||||
DeliverySetTime entity = new DeliverySetTime();
|
||||
BeanUtils.copyProperties(request, entity);
|
||||
if (deliverySetTimeService.save(entity)) {
|
||||
return CommonResult.success();
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('admin:deliveryTime:delete')")
|
||||
@ApiOperation(value = "删除")
|
||||
@RequestMapping(value = "/delete/{id}", method = RequestMethod.GET)
|
||||
@ApiImplicitParam(name="id", value="ID")
|
||||
public CommonResult<String> delete(@PathVariable Integer id) {
|
||||
if (deliverySetTimeService.removeById(id)) {
|
||||
return CommonResult.success();
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('admin:deliveryTime:update')")
|
||||
@ApiOperation(value = "修改")
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
||||
public CommonResult<String> update(@RequestBody @Validated DeliveryTimeRequest request) {
|
||||
DeliverySetTime entity = new DeliverySetTime();
|
||||
BeanUtils.copyProperties(request, entity);
|
||||
if (entity.getType() == 1) {
|
||||
entity.setStoreId(0);
|
||||
}
|
||||
if (deliverySetTimeService.updateById(entity)) {
|
||||
return CommonResult.success();
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('admin:deliveryTime:info')")
|
||||
@ApiOperation(value = "详情")
|
||||
@RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
|
||||
@ApiImplicitParam(name="id", value="ID")
|
||||
public CommonResult<DeliverySetTime> info(@PathVariable Integer id) {
|
||||
return CommonResult.success(deliverySetTimeService.getById(id));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,76 @@
|
||||
package com.zbkj.admin.controller;
|
||||
|
||||
import com.zbkj.common.model.system.SystemHelpProblem;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.request.SystemHelpRequest;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.service.service.HelpService;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("api/admin/system/helpProblem")
|
||||
@Api(tags = "系统帮助问题")
|
||||
public class SystemHelpController {
|
||||
|
||||
@Autowired
|
||||
private HelpService helpService;
|
||||
|
||||
@RequestMapping("/list")
|
||||
@PreAuthorize("hasAuthority('admin:helpProblem:list')")
|
||||
public CommonResult<CommonPage<SystemHelpProblem>> list(@Validated SystemHelpRequest request, @Validated PageParamRequest page) {
|
||||
SystemHelpProblem entity = new SystemHelpProblem();
|
||||
BeanUtils.copyProperties(request, entity);
|
||||
List<SystemHelpProblem> list = helpService.getListHelp(entity, page);
|
||||
return CommonResult.success(CommonPage.restPage(list));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
|
||||
@PreAuthorize("hasAuthority('admin:helpProblem:info')")
|
||||
public CommonResult<SystemHelpProblem> info(@PathVariable Integer id) {
|
||||
SystemHelpProblem entity = helpService.getById(id);
|
||||
return CommonResult.success(entity);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
||||
@PreAuthorize("hasAuthority('admin:helpProblem:save')")
|
||||
public CommonResult<String> save(@RequestBody SystemHelpRequest request) {
|
||||
SystemHelpProblem entity = new SystemHelpProblem();
|
||||
BeanUtils.copyProperties(request, entity);
|
||||
if (helpService.save(entity)) {
|
||||
return CommonResult.success();
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
||||
@PreAuthorize("hasAuthority('admin:helpProblem:update')")
|
||||
public CommonResult<String> update(@RequestBody SystemHelpRequest request) {
|
||||
SystemHelpProblem entity = new SystemHelpProblem();
|
||||
BeanUtils.copyProperties(request, entity);
|
||||
if (helpService.save(entity)) {
|
||||
return CommonResult.success();
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/delete/{id}", method = RequestMethod.GET)
|
||||
@PreAuthorize("hasAuthority('admin:helpProblem:delete')")
|
||||
public CommonResult<String> delete(@PathVariable Integer id) {
|
||||
if (helpService.removeById(id)) {
|
||||
return CommonResult.success();
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package com.zbkj.common.model.system;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
@ -8,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
@ -31,6 +33,11 @@ public class SystemHelpProblem implements Serializable {
|
||||
@ApiModelProperty(value = "分类id")
|
||||
private String cid;
|
||||
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "分类名称")
|
||||
private String cName;
|
||||
|
||||
@ApiModelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
|
@ -40,9 +40,9 @@ public class CategoryRequest implements Serializable {
|
||||
@Length(max = 50, message = "分类名称不能超过50个字符")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "类型,类型,1 产品分类,2 附件分类,3 文章分类, 4 设置分类, 5 菜单分类, 6 配置分类, 7 秒杀配置")
|
||||
@ApiModelProperty(value = "类型,类型,1 产品分类,2 附件分类,4 设置分类, 5 菜单分类,6 配置分类,7 秒杀配置,8 套餐分类,9 帮助分类")
|
||||
@NotNull(message = "类型必须选择")
|
||||
@Range(min = 1, max = 6, message = "类型,1 产品分类,2 附件分类,3 文章分类, 4 设置分类, 5 菜单分类, 6 配置分类, 7 秒杀配置之间") //取值范围
|
||||
@Range(min = 1, max = 9, message = "类型,1 产品分类,2 附件分类,4 设置分类, 5 菜单分类,6 配置分类,7 秒杀配置,8 套餐分类,9 帮助分类") //取值范围
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "地址")
|
||||
|
@ -0,0 +1,60 @@
|
||||
package com.zbkj.common.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="DeliveryTimeRequest对象", description="DeliveryTimeRequest对象")
|
||||
public class DeliveryTimeRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
/**
|
||||
* 预约配送天数
|
||||
*/
|
||||
@ApiModelProperty(value = "类型: 1-平台通用,2指定门店")
|
||||
private Integer appointDay;
|
||||
/**
|
||||
* 上午配送时间(9点-12点)
|
||||
*/
|
||||
@ApiModelProperty(value = "类型: 1-平台通用,2指定门店")
|
||||
private String amSendHour;
|
||||
/**
|
||||
* 下午配送时间(15点-19点)
|
||||
*/
|
||||
@ApiModelProperty(value = "下午配送时间")
|
||||
private String pmSendHour;
|
||||
/**
|
||||
* 配送区间(分钟)
|
||||
*/
|
||||
@ApiModelProperty(value = "配送区间(分钟)")
|
||||
private Integer sendSplit;
|
||||
/**
|
||||
* 1通用,2门店指定
|
||||
*/
|
||||
@ApiModelProperty(value = "类型: 1-平台通用,2指定门店")
|
||||
private Integer type;
|
||||
/**
|
||||
* 门店编号
|
||||
*/
|
||||
@ApiModelProperty(value = "门店编号")
|
||||
private Integer storeId;
|
||||
/**
|
||||
* 是否无效
|
||||
*/
|
||||
@ApiModelProperty(value = "是否无效 0无效,1有效")
|
||||
private Integer status;
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.zbkj.common.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="SystemHelpRequest对象", description="SystemHelpRequest对象")
|
||||
public class SystemHelpRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "分类id")
|
||||
private String cid;
|
||||
|
||||
@ApiModelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
import com.zbkj.common.constants.Constants;
|
||||
import com.zbkj.common.model.system.SystemHelpProblem;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
@ -38,7 +39,10 @@ public class HelpController {
|
||||
@ApiOperation(value = "分页列表")
|
||||
@RequestMapping(value = "/list/{cid}", method = RequestMethod.GET)
|
||||
public CommonResult<CommonPage<HelpResponse>> getListArticle(@PathVariable(name="cid") String cid, @Validated PageParamRequest pageParamRequest) {
|
||||
List<SystemHelpProblem> list = helpService.getListHelp(cid, pageParamRequest);
|
||||
SystemHelpProblem entity = new SystemHelpProblem();
|
||||
entity.setCid(cid);
|
||||
entity.setStatus(true);
|
||||
List<SystemHelpProblem> list = helpService.getListHelp(entity, pageParamRequest);
|
||||
List<HelpResponse> responseList = list.stream().map(e -> {
|
||||
HelpResponse response = new HelpResponse();
|
||||
BeanUtils.copyProperties(e, response);
|
||||
|
@ -9,6 +9,6 @@ import java.util.List;
|
||||
|
||||
public interface HelpDao extends BaseMapper<SystemHelpProblem> {
|
||||
|
||||
List<SystemHelpProblem> getListHelp(@Param("cid") String cid);
|
||||
List<SystemHelpProblem> getListHelp(@Param("entity") SystemHelpProblem entity);
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ package com.zbkj.service.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zbkj.common.model.deliveryset.DeliverySetTime;
|
||||
import com.zbkj.common.request.DeliveryTimeRequest;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.response.DeliveryTimeResponse;
|
||||
|
||||
import java.util.List;
|
||||
@ -12,5 +14,7 @@ public interface DeliverySetTimeService extends IService<DeliverySetTime> {
|
||||
|
||||
List<DeliveryTimeResponse> getDeliveryTime();
|
||||
|
||||
List<DeliverySetTime> getList(DeliveryTimeRequest request, PageParamRequest page);
|
||||
|
||||
}
|
||||
|
||||
|
@ -17,10 +17,10 @@ public interface HelpService extends IService<SystemHelpProblem> {
|
||||
|
||||
/**
|
||||
* 列表
|
||||
* @param cid 分类id
|
||||
* @param entity
|
||||
* @param pageParamRequest 分页类参数
|
||||
*/
|
||||
List<SystemHelpProblem> getListHelp(String cid, PageParamRequest pageParamRequest);
|
||||
List<SystemHelpProblem> getListHelp(SystemHelpProblem entity, PageParamRequest pageParamRequest);
|
||||
|
||||
/**
|
||||
* 获取文章分类列表
|
||||
|
@ -2,12 +2,17 @@ package com.zbkj.service.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.zbkj.common.constants.Constants;
|
||||
import com.zbkj.common.model.deliveryset.DeliverySetTime;
|
||||
import com.zbkj.common.model.user.UserTag;
|
||||
import com.zbkj.common.request.DeliveryTimeRequest;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.response.DeliveryTimeResponse;
|
||||
import com.zbkj.common.utils.DeliveryUtil;
|
||||
import com.zbkj.service.dao.DeliverySetTimeDao;
|
||||
import com.zbkj.service.service.DeliverySetTimeService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -41,4 +46,14 @@ public class DeliverySetTimeServiceImpl extends ServiceImpl<DeliverySetTimeDao,
|
||||
return DeliveryUtil.getHourlyTimeIntervals(startDate, numberOfDays, splitMin, morningStart, morningEnd, afternoonStart, afternoonEnd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeliverySetTime> getList(DeliveryTimeRequest request, PageParamRequest page) {
|
||||
PageHelper.startPage(page.getPage(), page.getLimit());
|
||||
LambdaQueryWrapper<DeliverySetTime> lw = new LambdaQueryWrapper<>();
|
||||
if (null != request.getType()) {
|
||||
lw.eq(DeliverySetTime::getType, request.getType());
|
||||
}
|
||||
return dao.selectList(lw);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -53,9 +53,9 @@ public class HelpServiceImpl extends ServiceImpl<HelpDao, SystemHelpProblem> imp
|
||||
private SystemAttachmentService systemAttachmentService;
|
||||
|
||||
@Override
|
||||
public List<SystemHelpProblem> getListHelp(String cid, PageParamRequest page) {
|
||||
public List<SystemHelpProblem> getListHelp(SystemHelpProblem entity, PageParamRequest page) {
|
||||
PageHelper.startPage(page.getPage(), page.getLimit());
|
||||
return dao.getListHelp(cid);
|
||||
return dao.getListHelp(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1090,7 +1090,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
||||
// 未发货订单
|
||||
response.setNotShipped(getCount(dateLimit, Constants.ORDER_STATUS_NOT_SHIPPED, type));
|
||||
// 备货中订单
|
||||
response.setNotShipped(getCount(dateLimit, Constants.ORDER_STATUS_PREPARE_ING, type));
|
||||
response.setPrepareIng(getCount(dateLimit, Constants.ORDER_STATUS_PREPARE_ING, type));
|
||||
// 待收货订单
|
||||
response.setSpike(getCount(dateLimit, Constants.ORDER_STATUS_SPIKE, type));
|
||||
// 待评价订单
|
||||
@ -1098,7 +1098,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
||||
// 交易完成订单
|
||||
response.setComplete(getCount(dateLimit, Constants.ORDER_STATUS_COMPLETE, type));
|
||||
// 待核销订单
|
||||
response.setToBeWrittenOff(getCount(dateLimit, Constants.ORDER_STATUS_TOBE_WRITTEN_OFF, type));
|
||||
// response.setToBeWrittenOff(getCount(dateLimit, Constants.ORDER_STATUS_TOBE_WRITTEN_OFF, type));
|
||||
// 退款中订单
|
||||
response.setRefunding(getCount(dateLimit, Constants.ORDER_STATUS_REFUNDING, type));
|
||||
// 已退款订单
|
||||
|
@ -6,7 +6,7 @@
|
||||
SELECT
|
||||
h.id,
|
||||
h.cid,
|
||||
c.`name`,
|
||||
c.`name` cName,
|
||||
h.title,
|
||||
h.synopsis,
|
||||
h.content,
|
||||
@ -21,7 +21,9 @@
|
||||
h.sort,
|
||||
h.create_time createTime
|
||||
FROM eb_system_help_problem h INNER JOIN eb_category c on h.cid = c.id and c.type = 9
|
||||
<if test="cid != null and cid != ''"> and c.id = #{cid} </if>
|
||||
<if test="entity.cid != null and entity.cid != ''"> and c.id = #{entity.cid} </if>
|
||||
<if test="entity.title != null and entity.title != ''"> and h.title like concat('%',#{entity.title}, '%') </if>
|
||||
<if test="entity.status != null"> and h.status = #{entity.status} </if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user