diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice.zip b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice.zip new file mode 100644 index 0000000..479eb11 Binary files /dev/null and b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice.zip differ diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/controller/ShopNoticeController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/controller/ShopNoticeController.java new file mode 100644 index 0000000..70a9aa5 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/controller/ShopNoticeController.java @@ -0,0 +1,171 @@ +package org.jeecg.modules.shopNotice.controller; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.shopNotice.entity.ShopNotice; +import org.jeecg.modules.shopNotice.service.IShopNoticeService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; + + /** + * @Description: 通告 + * @Author: jeecg-boot + * @Date: 2024-12-14 + * @Version: V1.0 + */ +@Api(tags="通告") +@RestController +@RequestMapping("/shopNotice/shopNotice") +@Slf4j +public class ShopNoticeController extends JeecgController { + @Autowired + private IShopNoticeService shopNoticeService; + + /** + * 分页列表查询 + * + * @param shopNotice + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "通告-分页列表查询") + @ApiOperation(value="通告-分页列表查询", notes="通告-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(ShopNotice shopNotice, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(shopNotice, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = shopNoticeService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param shopNotice + * @return + */ + @AutoLog(value = "通告-添加") + @ApiOperation(value="通告-添加", notes="通告-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody ShopNotice shopNotice) { + shopNoticeService.save(shopNotice); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param shopNotice + * @return + */ + @AutoLog(value = "通告-编辑") + @ApiOperation(value="通告-编辑", notes="通告-编辑") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody ShopNotice shopNotice) { + shopNoticeService.updateById(shopNotice); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "通告-通过id删除") + @ApiOperation(value="通告-通过id删除", notes="通告-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + shopNoticeService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "通告-批量删除") + @ApiOperation(value="通告-批量删除", notes="通告-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.shopNoticeService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "通告-通过id查询") + @ApiOperation(value="通告-通过id查询", notes="通告-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + ShopNotice shopNotice = shopNoticeService.getById(id); + if(shopNotice==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(shopNotice); + } + + /** + * 导出excel + * + * @param request + * @param shopNotice + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, ShopNotice shopNotice) { + return super.exportXls(request, shopNotice, ShopNotice.class, "通告"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, ShopNotice.class); + } + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/entity/ShopNotice.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/entity/ShopNotice.java new file mode 100644 index 0000000..35bed34 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/entity/ShopNotice.java @@ -0,0 +1,62 @@ +package org.jeecg.modules.shopNotice.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 通告 + * @Author: jeecg-boot + * @Date: 2024-12-14 + * @Version: V1.0 + */ +@Data +@TableName("shop_notice") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="shop_notice对象", description="通告") +public class ShopNotice implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**标题*/ + @Excel(name = "标题", width = 15) + @ApiModelProperty(value = "标题") + private java.lang.String title; + /**内容*/ + @Excel(name = "内容", width = 15) + @ApiModelProperty(value = "内容") + private java.lang.String details; + /**语言*/ + @Excel(name = "语言", width = 15) + @ApiModelProperty(value = "语言") + private java.lang.String yuyan; +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/mapper/ShopNoticeMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/mapper/ShopNoticeMapper.java new file mode 100644 index 0000000..26ff22f --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/mapper/ShopNoticeMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.shopNotice.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.shopNotice.entity.ShopNotice; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 通告 + * @Author: jeecg-boot + * @Date: 2024-12-14 + * @Version: V1.0 + */ +public interface ShopNoticeMapper extends BaseMapper { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/mapper/xml/ShopNoticeMapper.xml b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/mapper/xml/ShopNoticeMapper.xml new file mode 100644 index 0000000..0877b11 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/mapper/xml/ShopNoticeMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/service/IShopNoticeService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/service/IShopNoticeService.java new file mode 100644 index 0000000..e81fe42 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/service/IShopNoticeService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.shopNotice.service; + +import org.jeecg.modules.shopNotice.entity.ShopNotice; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 通告 + * @Author: jeecg-boot + * @Date: 2024-12-14 + * @Version: V1.0 + */ +public interface IShopNoticeService extends IService { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/service/impl/ShopNoticeServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/service/impl/ShopNoticeServiceImpl.java new file mode 100644 index 0000000..c242196 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/service/impl/ShopNoticeServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.shopNotice.service.impl; + +import org.jeecg.modules.shopNotice.entity.ShopNotice; +import org.jeecg.modules.shopNotice.mapper.ShopNoticeMapper; +import org.jeecg.modules.shopNotice.service.IShopNoticeService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 通告 + * @Author: jeecg-boot + * @Date: 2024-12-14 + * @Version: V1.0 + */ +@Service +public class ShopNoticeServiceImpl extends ServiceImpl implements IShopNoticeService { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue/ShopNoticeList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue/ShopNoticeList.vue new file mode 100644 index 0000000..71805de --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue/ShopNoticeList.vue @@ -0,0 +1,183 @@ + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue/modules/ShopNoticeForm.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue/modules/ShopNoticeForm.vue new file mode 100644 index 0000000..d59557a --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue/modules/ShopNoticeForm.vue @@ -0,0 +1,114 @@ + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue/modules/ShopNoticeModal.Style#Drawer.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue/modules/ShopNoticeModal.Style#Drawer.vue new file mode 100644 index 0000000..15f1de8 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue/modules/ShopNoticeModal.Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue/modules/ShopNoticeModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue/modules/ShopNoticeModal.vue new file mode 100644 index 0000000..aab22b6 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue/modules/ShopNoticeModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue3/ShopNotice.api.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue3/ShopNotice.api.ts new file mode 100644 index 0000000..482c0c5 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue3/ShopNotice.api.ts @@ -0,0 +1,61 @@ +import {defHttp} from '/@/utils/http/axios'; +import {Modal} from 'ant-design-vue'; + +enum Api { + list = '/shopNotice/shopNotice/list', + save='/shopNotice/shopNotice/add', + edit='/shopNotice/shopNotice/edit', + deleteOne = '/shopNotice/shopNotice/delete', + deleteBatch = '/shopNotice/shopNotice/deleteBatch', + importExcel = '/shopNotice/shopNotice/importExcel', + exportXls = '/shopNotice/shopNotice/exportXls', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + Modal.confirm({ + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue3/ShopNotice.data.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue3/ShopNotice.data.ts new file mode 100644 index 0000000..7351753 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue3/ShopNotice.data.ts @@ -0,0 +1,43 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '标题', + align:"center", + dataIndex: 'title' + }, + { + title: '内容', + align:"center", + dataIndex: 'details' + }, + { + title: '语言', + align:"center", + dataIndex: 'yuyan' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '标题', + field: 'title', + component: 'Input', + }, + { + label: '内容', + field: 'details', + component: 'Input', + }, + { + label: '语言', + field: 'yuyan', + component: 'Input', + }, +]; diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue3/ShopNoticeList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue3/ShopNoticeList.vue new file mode 100644 index 0000000..130ad89 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue3/ShopNoticeList.vue @@ -0,0 +1,162 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue3/components/ShopNoticeModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue3/components/ShopNoticeModal.vue new file mode 100644 index 0000000..b873068 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shopNotice/vue3/components/ShopNoticeModal.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/controller/IndexController.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/controller/IndexController.java index 924ea5d..3788550 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/controller/IndexController.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/controller/IndexController.java @@ -35,6 +35,16 @@ public class IndexController { return indexApiService.notice(); } + + + //首页提示 + @ApiOperation(value="首页提示", notes="首页提示") + @GetMapping(value = "/getPromptNotice") + public Result getPromptNotice(String us) + { + return indexApiService.getPromptNotice(us); + } + //首页图标 @ApiOperation(value="首页图标", notes="首页图标") @GetMapping(value = "/getIndexIcon") diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/IIndexApiService.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/IIndexApiService.java index e888492..e2da547 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/IIndexApiService.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/IIndexApiService.java @@ -8,6 +8,9 @@ public interface IIndexApiService { //获取通知 Result notice(); + + Result getPromptNotice(String us); + //获取提示 Result getPrompt(); diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/IndexApiServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/IndexApiServiceImpl.java index 7c0a696..1ca0893 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/IndexApiServiceImpl.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/IndexApiServiceImpl.java @@ -11,6 +11,8 @@ import org.jeecg.modules.shopIcon.entity.ShopIcon; import org.jeecg.modules.shopIcon.service.IShopIconService; import org.jeecg.modules.shopIconImage.entity.ShopIconImage; import org.jeecg.modules.shopIconImage.service.IShopIconImageService; +import org.jeecg.modules.shopNotice.entity.ShopNotice; +import org.jeecg.modules.shopNotice.service.IShopNoticeService; import org.jeecg.modules.shopVip.entity.ShopVip; import org.jeecg.modules.shopVip.service.IShopVipService; import org.springframework.stereotype.Service; @@ -34,6 +36,8 @@ public class IndexApiServiceImpl implements IIndexApiService { private IShopGiveMoneyService giveMoneyService; @Resource private IShopIconImageService iconImageService; + @Resource + private IShopNoticeService noticeService; //获取通知 @Override @@ -42,6 +46,16 @@ public class IndexApiServiceImpl implements IIndexApiService { return Result.OK(PromptUtils.query_success,notice); } + + @Override + public Result getPromptNotice(String us){ + ShopNotice shopNotice = noticeService.lambdaQuery() + .eq(ShopNotice::getYuyan, us) + .list().get(0); + return Result.OK(PromptUtils.query_success,shopNotice); + + } + //获取提示 @Override public Result getPrompt(){ diff --git a/shop/.env.development b/shop/.env.development index 0b0c3ad..4c19b43 100644 --- a/shop/.env.development +++ b/shop/.env.development @@ -1,5 +1,5 @@ NODE_ENV=development -VUE_APP_API_BASE_URL=https://api.olxbookbub.top/uav-oxl-api/ +VUE_APP_API_BASE_URL=https://api.oxlbook.top/uav-oxl-api/ VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview diff --git a/shop/.env.production b/shop/.env.production index a503308..29ab82e 100644 --- a/shop/.env.production +++ b/shop/.env.production @@ -1,4 +1,4 @@ NODE_ENV=production -VUE_APP_API_BASE_URL=https://api.olxbookbub.top/uav-oxl-api/ +VUE_APP_API_BASE_URL=https://api.oxlbook.top/uav-oxl-api/ VUE_APP_CAS_BASE_URL=http://localhost:8888/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview \ No newline at end of file