diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/common/utils/AlipayUtils.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/common/utils/AlipayUtils.java new file mode 100644 index 0000000..9792702 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/common/utils/AlipayUtils.java @@ -0,0 +1,136 @@ +package com.bonus.canteen.common.utils; + +import com.alipay.api.AlipayApiException; +import com.alipay.api.AlipayClient; +import com.alipay.api.AlipayConfig; +import com.alipay.api.DefaultAlipayClient; +import com.alipay.api.domain.AlipayTradeWapPayModel; +import com.alipay.api.request.AlipayOpenPublicTemplateMessageIndustryModifyRequest; +import com.alipay.api.request.AlipayTradeWapPayRequest; +import com.alipay.api.response.AlipayOpenPublicTemplateMessageIndustryModifyResponse; +import com.alipay.api.response.AlipayTradeWapPayResponse; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; + +/** + * @description: TODO + * @Author: zhh + * @CreateTime: 2025-01-2025/1/22 + * @Version: 1.0 + */ +@Slf4j +public class AlipayUtils { + @Value("${alipay.URL}") + private String URL; + + @Value("${alipay.APPID}") + private String APPID; + + @Value("${alipay.PRIVATE_KEY}") + private String PRIVATE_KEY; + @Value("${alipay.FORMAT}") + private String FORMAT; + @Value("${alipay.CHARSET}") + private String CHARSET; + @Value("${alipay.SIGN_TYPE}") + private String SIGN_TYPE; + @Value("${alipay.ALIPAY_PUBLIC_KEY}") + private String ALIPAY_PUBLIC_KEY; + + + public AlipayOpenPublicTemplateMessageIndustryModifyResponse getAlipay() { + + + AlipayConfig alipayConfig = new AlipayConfig(); +//设置网关地址 + alipayConfig.setServerUrl(URL); +//设置应用ID + alipayConfig.setAppId(APPID); +//设置应用私钥 + alipayConfig.setPrivateKey(PRIVATE_KEY); +//设置请求格式,固定值json + alipayConfig.setFormat(FORMAT); +//设置字符集 + alipayConfig.setCharset(CHARSET); +//设置签名类型 + alipayConfig.setSignType(SIGN_TYPE); +//设置支付宝公钥 + alipayConfig.setAlipayPublicKey(ALIPAY_PUBLIC_KEY); +//实例化客户端 + AlipayClient alipayClient = null; + try { + alipayClient = new DefaultAlipayClient(alipayConfig); + +//实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.open.public.template.message.industry.modify + AlipayOpenPublicTemplateMessageIndustryModifyRequest request = new AlipayOpenPublicTemplateMessageIndustryModifyRequest(); +//SDK已经封装掉了公共参数,这里只需要传入业务参数 +//此次只是参数展示,未进行字符串转义,实际情况下请转义 + request.setBizContent(" {" + + " \"primary_industry_name\":\"IT科技/IT软件与服务\"," + + " \"primary_industry_code\":\"10001/20102\"," + + " \"secondary_industry_code\":\"10001/20102\"," + + " \"secondary_industry_name\":\"IT科技/IT软件与服务\"" + + " }"); + AlipayOpenPublicTemplateMessageIndustryModifyResponse response = alipayClient.execute(request); + return response; + } catch (AlipayApiException e) { + e.printStackTrace(); + log.info("充值链接支付宝错误信息为: " + e); + return null; + } + + } + + + public AlipayTradeWapPayResponse getPayGoods() { + + try { + + AlipayConfig alipayConfig = new AlipayConfig(); +//设置网关地址 + alipayConfig.setServerUrl(URL); +//设置应用ID + alipayConfig.setAppId(APPID); +//设置应用私钥 + alipayConfig.setPrivateKey(PRIVATE_KEY); +//设置请求格式,固定值json + alipayConfig.setFormat(FORMAT); +//设置字符集 + alipayConfig.setCharset(CHARSET); +//设置签名类型 + alipayConfig.setSignType(SIGN_TYPE); +//设置支付宝公钥 + alipayConfig.setAlipayPublicKey(ALIPAY_PUBLIC_KEY); + AlipayClient alipayClient = new DefaultAlipayClient(alipayConfig); + AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest(); + AlipayTradeWapPayModel model = new AlipayTradeWapPayModel(); + model.setOutTradeNo("70501111111S001111119"); + model.setTotalAmount("9.00"); + model.setSubject("大乐透"); + model.setProductCode("QUICK_WAP_WAY"); + model.setSellerId("2088102147948060"); + request.setBizModel(model); + AlipayTradeWapPayResponse response = alipayClient.pageExecute(request, "POST"); + // 如果需要返回GET请求,请使用 + // AlipayTradeWapPayResponse response = alipayClient.pageExecute(request, "GET"); + String pageRedirectionData = response.getBody(); + System.out.println(pageRedirectionData); + + return response; + /* if (response.isSuccess()) { + System.out.println("调用成功"); + } else { + System.out.println("调用失败"); + // sdk版本是"4.38.0.ALL"及以上,可以参考下面的示例获取诊断链接 + // String diagnosisUrl = DiagnosisUtils.getDiagnosisUrl(response); + // System.out.println(diagnosisUrl); + }*/ + } catch (AlipayApiException e) { + e.printStackTrace(); + log.info("充值链接支付宝错误信息为: " + e); + return null; + } + } + +} + diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/controller/CustAddrController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/controller/CustAddrController.java new file mode 100644 index 0000000..6d52be6 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/controller/CustAddrController.java @@ -0,0 +1,89 @@ +package com.bonus.canteen.consumer.controller; + +import com.bonus.canteen.consumer.model.CustAddr; +import com.bonus.canteen.consumer.service.CustAddrService; +import com.bonus.common.core.web.controller.BaseController; +import com.bonus.common.core.web.page.TableDataInfo; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +import static com.bonus.common.core.utils.PageUtils.startPage; + +/** + * 地址信息表(CustAddr)表控制层 + * + * @author makejava + * @since 2025-01-17 11:19:45 + */ +@RestController +@RequestMapping("custAddr") +public class CustAddrController extends BaseController { + /** + * 服务对象 + */ + @Resource + private CustAddrService custAddrService; + + /** + * 分页查询 + * + * @return 查询结果 + */ + @GetMapping + public TableDataInfo queryByPage(CustAddr basicsCanteenEvaluate){ + startPage(); + List basicsComplaints = custAddrService.queryByPage(basicsCanteenEvaluate); + return getDataTable(basicsComplaints); + } + + + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("{id}") + public ResponseEntity queryById(@PathVariable("id") Long id) { + return ResponseEntity.ok(this.custAddrService.queryById(id)); + } + + /** + * 新增数据 + * + * @param custAddr 实体 + * @return 新增结果 + */ + @PostMapping + public ResponseEntity add(@Valid @RequestBody CustAddr custAddr) { + System.err.println(custAddr); + return ResponseEntity.ok(this.custAddrService.insert(custAddr)); + } + + /** + * 编辑数据 + * + * @return 编辑结果 + */ + @PutMapping + public ResponseEntity edit(@Valid @RequestBody CustAddr custAddr) { + return ResponseEntity.ok(this.custAddrService.update(custAddr)); + } + + /** + * 删除数据 + * + * @return 删除是否成功 + */ + @PostMapping("delect") + public ResponseEntity deleteById(@Valid @RequestBody CustAddr custAddr) { + return ResponseEntity.ok(this.custAddrService.deleteById(custAddr)); + } + +} + diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/controller/CustPlaceController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/controller/CustPlaceController.java new file mode 100644 index 0000000..aabcce1 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/controller/CustPlaceController.java @@ -0,0 +1,89 @@ +package com.bonus.canteen.consumer.controller; + +import com.bonus.canteen.consumer.model.CustAddr; +import com.bonus.canteen.consumer.model.CustPlace; +import com.bonus.canteen.consumer.service.CustPlaceService; +import com.bonus.common.core.web.controller.BaseController; +import com.bonus.common.core.web.page.TableDataInfo; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 位置信息表(CustPlace)表控制层 + * + * @author makejava + * @since 2025-01-17 13:15:52 + */ +@RestController +@RequestMapping("custPlace") +public class CustPlaceController extends BaseController { + /** + * 服务对象 + */ + @Resource + private CustPlaceService custPlaceService; + + /** + * 分页查询 + * + * @param custPlace 筛选条件 + * @return 查询结果 + */ + @GetMapping + public TableDataInfo queryByPage(CustPlace custPlace) { + startPage(); + List basicsComplaints = custPlaceService.queryByPage(custPlace); + return getDataTable(basicsComplaints); + } + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("{id}") + public ResponseEntity queryById(@PathVariable("id") Long id) { + return ResponseEntity.ok(this.custPlaceService.queryById(id)); + } + + /** + * 新增数据 + * + * @param custPlace 实体 + * @return 新增结果 + */ + @PostMapping + public ResponseEntity add(CustPlace custPlace) { + return ResponseEntity.ok(this.custPlaceService.insert(custPlace)); + } + + /** + * 编辑数据 + * + * @param custPlace 实体 + * @return 编辑结果 + */ + @PutMapping + public ResponseEntity edit(CustPlace custPlace) { + return ResponseEntity.ok(this.custPlaceService.update(custPlace)); + } + + /** + * 删除数据 + * + * @param id 主键 + * @return 删除是否成功 + */ + @DeleteMapping + public ResponseEntity deleteById(Long id) { + return ResponseEntity.ok(this.custPlaceService.deleteById(id)); + } + +} + diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/controller/SysNoticeController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/controller/SysNoticeController.java new file mode 100644 index 0000000..95ea362 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/controller/SysNoticeController.java @@ -0,0 +1,114 @@ +package com.bonus.canteen.consumer.controller; + +import com.bonus.canteen.consumer.model.SysNotice; +import com.bonus.canteen.consumer.service.ISysNoticeService; +import com.bonus.common.core.web.controller.BaseController; +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.common.core.web.page.TableDataInfo; +import com.bonus.common.log.annotation.SysLog; +import com.bonus.common.log.enums.OperaType; +import com.bonus.common.security.annotation.InnerAuth; +import com.bonus.common.security.annotation.RequiresPermissions; +import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth; +import com.bonus.common.security.utils.SecurityUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + +/** + * 公告信息操作处理 + * + * @author bonus + */ +@RestController +@RequestMapping("/notice") +@Slf4j +public class SysNoticeController extends BaseController +{ + @Autowired + private ISysNoticeService noticeService; + + /** + * 获取通知公告列表 + */ + @GetMapping("/list") + @SysLog(title = "通知公告", businessType = OperaType.QUERY,logType = 0,module = "系统管理->通知公告") + public TableDataInfo list(SysNotice notice) { + try{ + startPage(); + List list = noticeService.selectNoticeList(notice); + return getDataTable(list); + }catch (Exception e){ + log.error(e.toString(),e); + } + return getDataTableError(new ArrayList<>()); + } + + /** + * 根据通知公告编号获取详细信息 + */ + @GetMapping + public AjaxResult getInfo( SysNotice noticeId) { + try{ + return success(noticeService.selectNoticeById(noticeId.getNoticeId())); + }catch (Exception e){ + log.error(e.toString(),e); + } + return error("系统异常"); + } + + /** + * 新增通知公告 + */ + @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:notice:add")) + @PostMapping + @SysLog(title = "通知公告", businessType = OperaType.INSERT,logType = 0,module = "系统管理->通知公告") + public AjaxResult add(@Validated @RequestBody SysNotice notice) { + try{ + notice.setCreateBy(SecurityUtils.getUsername()); + return toAjax(noticeService.insertNotice(notice)); + }catch (Exception e){ + log.error(e.toString(),e); + } + return error("系统异常"); + + + } + + /** + * 修改通知公告 + */ + @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:notice:edit")) + @PostMapping("/edit") + @SysLog(title = "通知公告", businessType = OperaType.UPDATE,logType = 0,module = "系统管理->通知公告") + public AjaxResult edit(@Validated @RequestBody SysNotice notice) { + try{ + notice.setUpdateBy(SecurityUtils.getUsername()); + return toAjax(noticeService.updateNotice(notice)); + }catch (Exception e){ + log.error(e.toString(),e); + } + return error("系统异常"); + + } + + /** + * 删除通知公告 + */ + @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:notice:remove")) + @PostMapping("/delete/{noticeIds}") + @SysLog(title = "通知公告", businessType = OperaType.DELETE,logType = 0,module = "系统管理->通知公告") + public AjaxResult remove(@PathVariable Long[] noticeIds) { + try{ + return toAjax(noticeService.deleteNoticeByIds(noticeIds)); + }catch (Exception e){ + log.error(e.toString(),e); + } + return error("系统异常"); + + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/mapper/CustAddrMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/mapper/CustAddrMapper.java new file mode 100644 index 0000000..5330e5e --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/mapper/CustAddrMapper.java @@ -0,0 +1,84 @@ +package com.bonus.canteen.consumer.mapper; + +import com.bonus.canteen.consumer.model.CustAddr; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 地址信息表(CustAddr)表数据库访问层 + * + * @author makejava + * @since 2025-01-17 11:19:45 + */ +@Mapper +public interface CustAddrMapper { + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + CustAddr queryById(Long id); + + /** + * 查询指定行数据 + * + * @param custAddr 查询条件 + * @return 对象列表 + */ + List queryAllByLimit(CustAddr custAddr); + + /** + * 统计总行数 + * + * @param custAddr 查询条件 + * @return 总行数 + */ + long count(CustAddr custAddr); + + /** + * 新增数据 + * + * @param custAddr 实例对象 + * @return 影响行数 + */ + int insert(CustAddr custAddr); + + /** + * 批量新增数据(MyBatis原生foreach方法) + * + * @param entities List 实例对象列表 + * @return 影响行数 + */ + int insertBatch(@Param("entities") List entities); + + /** + * 批量新增或按主键更新数据(MyBatis原生foreach方法) + * + * @param entities List 实例对象列表 + * @return 影响行数 + * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 + */ + int insertOrUpdateBatch(@Param("entities") List entities); + + /** + * 修改数据 + * + * @param custAddr 实例对象 + * @return 影响行数 + */ + int update(CustAddr custAddr); + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 影响行数 + */ + int deleteById(Long id); + +} + diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/mapper/CustPlaceMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/mapper/CustPlaceMapper.java new file mode 100644 index 0000000..405e59c --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/mapper/CustPlaceMapper.java @@ -0,0 +1,82 @@ +package com.bonus.canteen.consumer.mapper; + +import com.bonus.canteen.consumer.model.CustPlace; +import org.apache.ibatis.annotations.Param; +import org.springframework.data.domain.Pageable; +import java.util.List; + +/** + * 位置信息表(CustPlace)表数据库访问层 + * + * @author makejava + * @since 2025-01-17 13:15:52 + */ +public interface CustPlaceMapper { + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + CustPlace queryById(Long id); + + /** + * 查询指定行数据 + * + * @param custPlace 查询条件 + * @return 对象列表 + */ + List queryAllByLimit(CustPlace custPlace); + + /** + * 统计总行数 + * + * @param custPlace 查询条件 + * @return 总行数 + */ + long count(CustPlace custPlace); + + /** + * 新增数据 + * + * @param custPlace 实例对象 + * @return 影响行数 + */ + int insert(CustPlace custPlace); + + /** + * 批量新增数据(MyBatis原生foreach方法) + * + * @param entities List 实例对象列表 + * @return 影响行数 + */ + int insertBatch(@Param("entities") List entities); + + /** + * 批量新增或按主键更新数据(MyBatis原生foreach方法) + * + * @param entities List 实例对象列表 + * @return 影响行数 + * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 + */ + int insertOrUpdateBatch(@Param("entities") List entities); + + /** + * 修改数据 + * + * @param custPlace 实例对象 + * @return 影响行数 + */ + int update(CustPlace custPlace); + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 影响行数 + */ + int deleteById(Long id); + +} + diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/mapper/SysNoticeMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/mapper/SysNoticeMapper.java new file mode 100644 index 0000000..d225300 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/mapper/SysNoticeMapper.java @@ -0,0 +1,62 @@ +package com.bonus.canteen.consumer.mapper; + + +import com.bonus.canteen.consumer.model.SysNotice; + +import java.util.List; + +/** + * 通知公告表 数据层 + * + * @author bonus + */ +public interface SysNoticeMapper +{ + /** + * 查询公告信息 + * + * @param noticeId 公告ID + * @return 公告信息 + */ + public SysNotice selectNoticeById(Long noticeId); + + /** + * 查询公告列表 + * + * @param notice 公告信息 + * @return 公告集合 + */ + public List selectNoticeList(SysNotice notice); + + /** + * 新增公告 + * + * @param notice 公告信息 + * @return 结果 + */ + public int insertNotice(SysNotice notice); + + /** + * 修改公告 + * + * @param notice 公告信息 + * @return 结果 + */ + public int updateNotice(SysNotice notice); + + /** + * 批量删除公告 + * + * @param noticeId 公告ID + * @return 结果 + */ + public int deleteNoticeById(Long noticeId); + + /** + * 批量删除公告信息 + * + * @param noticeIds 需要删除的公告ID + * @return 结果 + */ + public int deleteNoticeByIds(Long[] noticeIds); +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/model/CustAddr.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/model/CustAddr.java new file mode 100644 index 0000000..26ec598 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/model/CustAddr.java @@ -0,0 +1,237 @@ +package com.bonus.canteen.consumer.model; + +import com.bonus.common.core.web.domain.BaseEntity; +import lombok.Data; + +import java.util.Date; +import java.io.Serializable; + +/** + * 地址信息表(CustAddr)实体类 + * + * @author makejava + * @since 2025-01-17 11:19:45 + */ +@Data +public class CustAddr extends BaseEntity { + private static final long serialVersionUID = -12508504296065774L; + /** + * 主键自增 + */ + private Long id; + /** + * 人员id + */ + private Long custId; + /** + * 地址id + */ + private Long addrId; + /** + * 人员姓名 + */ + private String custName; + /** + * 手机号 + */ + private String mobile; + /** + * 地区代码 国家统一地区代码,到县级别 + */ + private String areaCode; + /** + * 详细地址 + */ + private String detailAddr; + /** + * 地址全称 + */ + private String addrFullName; + /** + * openid + */ + private String openid; + /** + * 来源类型 1-钉钉 2-微信 3-小程序 + */ + private Integer sourceType; + /** + * 是否默认 1-是,2-否 + */ + private Integer ifDefault; + /** + * 是否删除 1-是,2-否 + */ + private Integer ifDel; + /** + * 乐观锁 + */ + private Integer revision; + /** + * 创建人 + */ + private String crby; + /** + * 创建时间 + */ + private Date crtime; + /** + * 更新人 + */ + private String upby; + /** + * 更新时间 + */ + private Date uptime; + /** + * 位置信息id + */ + private Long placeId; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCustId() { + return custId; + } + + public void setCustId(Long custId) { + this.custId = custId; + } + + public Long getAddrId() { + return addrId; + } + + public void setAddrId(Long addrId) { + this.addrId = addrId; + } + + public String getCustName() { + return custName; + } + + public void setCustName(String custName) { + this.custName = custName; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getAreaCode() { + return areaCode; + } + + public void setAreaCode(String areaCode) { + this.areaCode = areaCode; + } + + public String getDetailAddr() { + return detailAddr; + } + + public void setDetailAddr(String detailAddr) { + this.detailAddr = detailAddr; + } + + public String getAddrFullName() { + return addrFullName; + } + + public void setAddrFullName(String addrFullName) { + this.addrFullName = addrFullName; + } + + public String getOpenid() { + return openid; + } + + public void setOpenid(String openid) { + this.openid = openid; + } + + public Integer getSourceType() { + return sourceType; + } + + public void setSourceType(Integer sourceType) { + this.sourceType = sourceType; + } + + public Integer getIfDefault() { + return ifDefault; + } + + public void setIfDefault(Integer ifDefault) { + this.ifDefault = ifDefault; + } + + public Integer getIfDel() { + return ifDel; + } + + public void setIfDel(Integer ifDel) { + this.ifDel = ifDel; + } + + public Integer getRevision() { + return revision; + } + + public void setRevision(Integer revision) { + this.revision = revision; + } + + public String getCrby() { + return crby; + } + + public void setCrby(String crby) { + this.crby = crby; + } + + public Date getCrtime() { + return crtime; + } + + public void setCrtime(Date crtime) { + this.crtime = crtime; + } + + public String getUpby() { + return upby; + } + + public void setUpby(String upby) { + this.upby = upby; + } + + public Date getUptime() { + return uptime; + } + + public void setUptime(Date uptime) { + this.uptime = uptime; + } + + public Long getPlaceId() { + return placeId; + } + + public void setPlaceId(Long placeId) { + this.placeId = placeId; + } + +} + diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/model/CustPlace.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/model/CustPlace.java new file mode 100644 index 0000000..3da255c --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/model/CustPlace.java @@ -0,0 +1,305 @@ +package com.bonus.canteen.consumer.model; + +import java.util.Date; +import java.io.Serializable; + +/** + * 位置信息表(CustPlace)实体类 + * + * @author makejava + * @since 2025-01-17 13:15:52 + */ +public class CustPlace implements Serializable { + private static final long serialVersionUID = -28700473554806189L; + /** + * 主键自增 + */ + private Long id; + /** + * 位置id + */ + private Long placeId; + /** + * 位置编号(商户自定义) + */ + private String placeNum; + /** + * 位置名称 + */ + private String placeName; + /** + * 位置级别 + */ + private Integer placeLevel; + /** + * 是否是最后一级 1 是 2 否 + */ + private Integer ifLast; + /** + * 上级位置id + */ + private Long superId; + /** + * 位置全称 + */ + private String placeFullName; + /** + * 位置图片路径 + */ + private String placeUrl; + /** + * 食堂id + */ + private Long canteenId; + /** + * 档口id + */ + private Long shopstallId; + /** + * 特殊菜谱id + */ + private Long specialRecipeId; + /** + * 通用菜谱id + */ + private Long commonRecipeId; + /** + * 备注 + */ + private String remarks; + /** + * 是否删除 1-是 2-否 + */ + private Integer ifDel; + /** + * 乐观锁 + */ + private Integer revision; + /** + * 创建人 + */ + private String crby; + /** + * 创建时间 + */ + private Date crtime; + /** + * 更新人 + */ + private String upby; + /** + * 更新时间 + */ + private Date uptime; + /** + * 订餐员 + */ + private Long userId; + /** + * 父级id集合 + */ + private String superIds; + /** + * 是否是公用码 + */ + private Integer publicCode; + /** + * 排序号 + */ + private String sort; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPlaceId() { + return placeId; + } + + public void setPlaceId(Long placeId) { + this.placeId = placeId; + } + + public String getPlaceNum() { + return placeNum; + } + + public void setPlaceNum(String placeNum) { + this.placeNum = placeNum; + } + + public String getPlaceName() { + return placeName; + } + + public void setPlaceName(String placeName) { + this.placeName = placeName; + } + + public Integer getPlaceLevel() { + return placeLevel; + } + + public void setPlaceLevel(Integer placeLevel) { + this.placeLevel = placeLevel; + } + + public Integer getIfLast() { + return ifLast; + } + + public void setIfLast(Integer ifLast) { + this.ifLast = ifLast; + } + + public Long getSuperId() { + return superId; + } + + public void setSuperId(Long superId) { + this.superId = superId; + } + + public String getPlaceFullName() { + return placeFullName; + } + + public void setPlaceFullName(String placeFullName) { + this.placeFullName = placeFullName; + } + + public String getPlaceUrl() { + return placeUrl; + } + + public void setPlaceUrl(String placeUrl) { + this.placeUrl = placeUrl; + } + + public Long getCanteenId() { + return canteenId; + } + + public void setCanteenId(Long canteenId) { + this.canteenId = canteenId; + } + + public Long getShopstallId() { + return shopstallId; + } + + public void setShopstallId(Long shopstallId) { + this.shopstallId = shopstallId; + } + + public Long getSpecialRecipeId() { + return specialRecipeId; + } + + public void setSpecialRecipeId(Long specialRecipeId) { + this.specialRecipeId = specialRecipeId; + } + + public Long getCommonRecipeId() { + return commonRecipeId; + } + + public void setCommonRecipeId(Long commonRecipeId) { + this.commonRecipeId = commonRecipeId; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public Integer getIfDel() { + return ifDel; + } + + public void setIfDel(Integer ifDel) { + this.ifDel = ifDel; + } + + public Integer getRevision() { + return revision; + } + + public void setRevision(Integer revision) { + this.revision = revision; + } + + public String getCrby() { + return crby; + } + + public void setCrby(String crby) { + this.crby = crby; + } + + public Date getCrtime() { + return crtime; + } + + public void setCrtime(Date crtime) { + this.crtime = crtime; + } + + public String getUpby() { + return upby; + } + + public void setUpby(String upby) { + this.upby = upby; + } + + public Date getUptime() { + return uptime; + } + + public void setUptime(Date uptime) { + this.uptime = uptime; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getSuperIds() { + return superIds; + } + + public void setSuperIds(String superIds) { + this.superIds = superIds; + } + + public Integer getPublicCode() { + return publicCode; + } + + public void setPublicCode(Integer publicCode) { + this.publicCode = publicCode; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort; + } + +} + diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/model/SysNotice.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/model/SysNotice.java new file mode 100644 index 0000000..0234661 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/model/SysNotice.java @@ -0,0 +1,103 @@ +package com.bonus.canteen.consumer.model; + +import com.bonus.common.core.web.domain.BaseEntity; +import com.bonus.common.core.xss.Xss; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; + +/** + * 通知公告表 sys_notice + * + * @author bonus + */ +public class SysNotice extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 公告ID */ + private Long noticeId; + + /** 公告标题 */ + private String noticeTitle; + + /** 公告类型(1通知 2公告) */ + private String noticeType; + + /** 公告内容 */ + private String noticeContent; + + /** 公告状态(0正常 1关闭) */ + private String status; + + public Long getNoticeId() + { + return noticeId; + } + + public void setNoticeId(Long noticeId) + { + this.noticeId = noticeId; + } + + public void setNoticeTitle(String noticeTitle) + { + this.noticeTitle = noticeTitle; + } + + @Xss(message = "公告标题不能包含脚本字符") + @NotBlank(message = "公告标题不能为空") + @Size(min = 0, max = 50, message = "公告标题不能超过50个字符") + public String getNoticeTitle() + { + return noticeTitle; + } + + public void setNoticeType(String noticeType) + { + this.noticeType = noticeType; + } + + public String getNoticeType() + { + return noticeType; + } + + public void setNoticeContent(String noticeContent) + { + this.noticeContent = noticeContent; + } + + public String getNoticeContent() + { + return noticeContent; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("noticeId", getNoticeId()) + .append("noticeTitle", getNoticeTitle()) + .append("noticeType", getNoticeType()) + .append("noticeContent", getNoticeContent()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/CustAddrService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/CustAddrService.java new file mode 100644 index 0000000..ea3cb43 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/CustAddrService.java @@ -0,0 +1,53 @@ +package com.bonus.canteen.consumer.service; + +import com.bonus.canteen.consumer.model.CustAddr; + +import java.util.List; + +/** + * 地址信息表(CustAddr)表服务接口 + * + * @author makejava + * @since 2025-01-17 11:19:59 + */ +public interface CustAddrService { + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + CustAddr queryById(Long id); + + /** + * 分页查询 + * + */ + List queryByPage(CustAddr custAddr); + + /** + * 新增数据 + * + * @param custAddr 实例对象 + * @return 实例对象 + */ + Integer insert(CustAddr custAddr); + + /** + * 修改数据 + * + * @param custAddr 实例对象 + * @return 实例对象 + */ + CustAddr update(CustAddr custAddr); + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 是否成功 + */ + boolean deleteById(CustAddr custAddr); + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/CustPlaceService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/CustPlaceService.java new file mode 100644 index 0000000..4bda523 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/CustPlaceService.java @@ -0,0 +1,57 @@ +package com.bonus.canteen.consumer.service; + +import com.bonus.canteen.consumer.model.CustPlace; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; + +import java.util.List; + +/** + * 位置信息表(CustPlace)表服务接口 + * + * @author makejava + * @since 2025-01-17 13:15:52 + */ +public interface CustPlaceService { + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + CustPlace queryById(Long id); + + /** + * 分页查询 + * + * @param custPlace 筛选条件 + * @return 查询结果 + */ + List queryByPage(CustPlace custPlace); + + /** + * 新增数据 + * + * @param custPlace 实例对象 + * @return 实例对象 + */ + CustPlace insert(CustPlace custPlace); + + /** + * 修改数据 + * + * @param custPlace 实例对象 + * @return 实例对象 + */ + CustPlace update(CustPlace custPlace); + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 是否成功 + */ + boolean deleteById(Long id); + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/ISysNoticeService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/ISysNoticeService.java new file mode 100644 index 0000000..dcd95d4 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/ISysNoticeService.java @@ -0,0 +1,62 @@ +package com.bonus.canteen.consumer.service; + + +import com.bonus.canteen.consumer.model.SysNotice; + +import java.util.List; + +/** + * 公告 服务层 + * + * @author bonus + */ +public interface ISysNoticeService +{ + /** + * 查询公告信息 + * + * @param noticeId 公告ID + * @return 公告信息 + */ + public SysNotice selectNoticeById(Long noticeId); + + /** + * 查询公告列表 + * + * @param notice 公告信息 + * @return 公告集合 + */ + public List selectNoticeList(SysNotice notice); + + /** + * 新增公告 + * + * @param notice 公告信息 + * @return 结果 + */ + public int insertNotice(SysNotice notice); + + /** + * 修改公告 + * + * @param notice 公告信息 + * @return 结果 + */ + public int updateNotice(SysNotice notice); + + /** + * 删除公告信息 + * + * @param noticeId 公告ID + * @return 结果 + */ + public int deleteNoticeById(Long noticeId); + + /** + * 批量删除公告信息 + * + * @param noticeIds 需要删除的公告ID + * @return 结果 + */ + public int deleteNoticeByIds(Long[] noticeIds); +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/impl/CustAddrServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/impl/CustAddrServiceImpl.java new file mode 100644 index 0000000..f9fe2b2 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/impl/CustAddrServiceImpl.java @@ -0,0 +1,93 @@ +package com.bonus.canteen.consumer.service.impl; + +import com.bonus.canteen.common.utils.StringUtil; +import com.bonus.canteen.common.utils.StringUtils; +import com.bonus.canteen.consumer.model.CustAddr; +import com.bonus.canteen.consumer.mapper.CustAddrMapper; +import com.bonus.canteen.consumer.service.CustAddrService; +import com.bonus.common.security.utils.SecurityUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.security.Security; +import java.util.Date; +import java.util.List; + +/** + * 地址信息表(CustAddr)表服务实现类 + * + * @author makejava + * @since 2025-01-17 11:19:59 + */ +@Service("custAddrService") +public class CustAddrServiceImpl implements CustAddrService { + @Resource + private CustAddrMapper custAddrDao; + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + @Override + public CustAddr queryById(Long id) { + return this.custAddrDao.queryById(id); + } + + /** + * 分页查询 + * + * @param custAddr 筛选条件 + * @return 查询结果 + */ + @Override + public List queryByPage(CustAddr custAddr) { + return this.custAddrDao.queryAllByLimit(custAddr); + } + + /** + * 新增数据 + * + * @param custAddr 实例对象 + * @return 实例对象 + */ + @Override + public Integer insert(CustAddr custAddr) { + custAddr.setAddrId(StringUtil.generateRandomLong(18)); + Long userid = SecurityUtils.getLoginUser().getUserid(); + if (StringUtils.isNull(userid)){ + return null; + } + custAddr.setCrby(userid.toString()); + custAddr.setUpby(userid.toString()); + custAddr.setUptime(new Date()); + custAddr.setCrtime(new Date()); + //place 位置信息 + + return this.custAddrDao.insert(custAddr); + } + + /** + * 修改数据 + * + * @param custAddr 实例对象 + * @return 实例对象 + */ + @Override + public CustAddr update(CustAddr custAddr) { + this.custAddrDao.update(custAddr); + return this.queryById(custAddr.getId()); + } + + /** + * 通过主键删除数据 + * + * @return 是否成功 + */ + @Override + public boolean deleteById(CustAddr custAddr) { + custAddr.setIfDel(1); + return this.custAddrDao.update(custAddr) > 0; + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/impl/CustPlaceServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/impl/CustPlaceServiceImpl.java new file mode 100644 index 0000000..fa0527a --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/impl/CustPlaceServiceImpl.java @@ -0,0 +1,81 @@ +package com.bonus.canteen.consumer.service.impl; + +import com.bonus.canteen.consumer.model.CustPlace; +import com.bonus.canteen.consumer.mapper.CustPlaceMapper; +import com.bonus.canteen.consumer.service.CustPlaceService; +import org.springframework.stereotype.Service; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.PageRequest; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 位置信息表(CustPlace)表服务实现类 + * + * @author makejava + * @since 2025-01-17 13:15:52 + */ +@Service("custPlaceService") +public class CustPlaceServiceImpl implements CustPlaceService { + @Resource + private CustPlaceMapper custPlaceDao; + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + @Override + public CustPlace queryById(Long id) { + return this.custPlaceDao.queryById(id); + } + + /** + * 分页查询 + * + * @param custPlace 筛选条件 + * @return 查询结果 + */ + @Override + public List queryByPage(CustPlace custPlace) { + return this.custPlaceDao.queryAllByLimit(custPlace); + } + + /** + * 新增数据 + * + * @param custPlace 实例对象 + * @return 实例对象 + */ + @Override + public CustPlace insert(CustPlace custPlace) { + this.custPlaceDao.insert(custPlace); + return custPlace; + } + + /** + * 修改数据 + * + * @param custPlace 实例对象 + * @return 实例对象 + */ + @Override + public CustPlace update(CustPlace custPlace) { + this.custPlaceDao.update(custPlace); + return this.queryById(custPlace.getId()); + } + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Long id) { + return this.custPlaceDao.deleteById(id) > 0; + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/impl/SysNoticeServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/impl/SysNoticeServiceImpl.java new file mode 100644 index 0000000..4a897f9 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/consumer/service/impl/SysNoticeServiceImpl.java @@ -0,0 +1,92 @@ +package com.bonus.canteen.consumer.service.impl; +import com.bonus.canteen.consumer.mapper.SysNoticeMapper; +import com.bonus.canteen.consumer.model.SysNotice; +import com.bonus.canteen.consumer.service.ISysNoticeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 公告 服务层实现 + * + * @author bonus + */ +@Service +public class SysNoticeServiceImpl implements ISysNoticeService +{ + @Autowired + private SysNoticeMapper noticeMapper; + + /** + * 查询公告信息 + * + * @param noticeId 公告ID + * @return 公告信息 + */ + @Override + public SysNotice selectNoticeById(Long noticeId) + { + return noticeMapper.selectNoticeById(noticeId); + } + + /** + * 查询公告列表 + * + * @param notice 公告信息 + * @return 公告集合 + */ + @Override + public List selectNoticeList(SysNotice notice) + { + return noticeMapper.selectNoticeList(notice); + } + + /** + * 新增公告 + * + * @param notice 公告信息 + * @return 结果 + */ + @Override + public int insertNotice(SysNotice notice) + { + return noticeMapper.insertNotice(notice); + } + + /** + * 修改公告 + * + * @param notice 公告信息 + * @return 结果 + */ + @Override + public int updateNotice(SysNotice notice) + { + return noticeMapper.updateNotice(notice); + } + + /** + * 删除公告对象 + * + * @param noticeId 公告ID + * @return 结果 + */ + @Override + public int deleteNoticeById(Long noticeId) + { + return noticeMapper.deleteNoticeById(noticeId); + } + + /** + * 批量删除公告信息 + * + * @param noticeIds 需要删除的公告ID + * @return 结果 + */ + @Override + public int deleteNoticeByIds(Long[] noticeIds) + { + return noticeMapper.deleteNoticeByIds(noticeIds); + } +}