diff --git a/flossom-common/flossom-common-hzMapper/src/main/java/com/flossom/hzMapper/domain/IntegralGlobal.java b/flossom-common/flossom-common-hzMapper/src/main/java/com/flossom/hzMapper/domain/IntegralGlobal.java new file mode 100644 index 0000000..e59358a --- /dev/null +++ b/flossom-common/flossom-common-hzMapper/src/main/java/com/flossom/hzMapper/domain/IntegralGlobal.java @@ -0,0 +1,55 @@ +package com.flossom.hzMapper.domain; + +import com.flossom.common.core.annotation.Excel; +import com.flossom.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 奖励积分对象 integral_global + * + * @author flossom + * @date 2023-12-11 + */ +public class IntegralGlobal extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 初始奖励积分 */ + @Excel(name = "初始奖励积分") + private Long integral; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setIntegral(Long integral) + { + this.integral = integral; + } + + public Long getIntegral() + { + return integral; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("integral", getIntegral()) + .append("createTime", getCreateTime()) + .append("createBy", getCreateBy()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/flossom-common/flossom-common-hzMapper/src/main/java/com/flossom/hzMapper/mapper/IntegralGlobalMapper.java b/flossom-common/flossom-common-hzMapper/src/main/java/com/flossom/hzMapper/mapper/IntegralGlobalMapper.java new file mode 100644 index 0000000..b213b33 --- /dev/null +++ b/flossom-common/flossom-common-hzMapper/src/main/java/com/flossom/hzMapper/mapper/IntegralGlobalMapper.java @@ -0,0 +1,62 @@ +package com.flossom.hzMapper.mapper; + +import com.flossom.hzMapper.domain.IntegralGlobal; + +import java.util.List; + +/** + * 奖励积分Mapper接口 + * + * @author flossom + * @date 2023-12-11 + */ +public interface IntegralGlobalMapper +{ + /** + * 查询奖励积分 + * + * @param id 奖励积分主键 + * @return 奖励积分 + */ + public IntegralGlobal selectIntegralGlobalById(Long id); + + /** + * 查询奖励积分列表 + * + * @param integralGlobal 奖励积分 + * @return 奖励积分集合 + */ + public List selectIntegralGlobalList(IntegralGlobal integralGlobal); + + /** + * 新增奖励积分 + * + * @param integralGlobal 奖励积分 + * @return 结果 + */ + public int insertIntegralGlobal(IntegralGlobal integralGlobal); + + /** + * 修改奖励积分 + * + * @param integralGlobal 奖励积分 + * @return 结果 + */ + public int updateIntegralGlobal(IntegralGlobal integralGlobal); + + /** + * 删除奖励积分 + * + * @param id 奖励积分主键 + * @return 结果 + */ + public int deleteIntegralGlobalById(Long id); + + /** + * 批量删除奖励积分 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteIntegralGlobalByIds(Long[] ids); +} diff --git a/flossom-common/flossom-common-hzMapper/src/main/resources/mapper/hzMapper/IntegralGlobalMapper.xml b/flossom-common/flossom-common-hzMapper/src/main/resources/mapper/hzMapper/IntegralGlobalMapper.xml new file mode 100644 index 0000000..66b48a6 --- /dev/null +++ b/flossom-common/flossom-common-hzMapper/src/main/resources/mapper/hzMapper/IntegralGlobalMapper.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + select id, integral, create_time, create_by, update_by, update_time from integral_global + + + + + + + + insert into integral_global + + id, + integral, + create_time, + create_by, + update_by, + update_time, + + + #{id}, + #{integral}, + #{createTime}, + #{createBy}, + #{updateBy}, + #{updateTime}, + + + + + update integral_global + + integral = #{integral}, + create_time = #{createTime}, + create_by = #{createBy}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from integral_global where id = #{id} + + + + delete from integral_global where id in + + #{id} + + + diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/IntegralGlobalController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/IntegralGlobalController.java new file mode 100644 index 0000000..38ee33a --- /dev/null +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/IntegralGlobalController.java @@ -0,0 +1,106 @@ +package com.flossom.system.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +import com.flossom.common.core.utils.poi.ExcelUtil; +import com.flossom.common.core.web.controller.BaseController; +import com.flossom.common.core.web.domain.AjaxResult; +import com.flossom.common.core.web.page.TableDataInfo; +import com.flossom.common.log.annotation.Log; +import com.flossom.common.log.enums.BusinessType; +import com.flossom.common.security.annotation.RequiresPermissions; +import com.flossom.hzMapper.domain.IntegralGlobal; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.flossom.system.service.IIntegralGlobalService; + +/** + * 奖励积分Controller + * + * @author flossom + * @date 2023-12-11 + */ +@RestController +@RequestMapping("/globalIntegral") +public class IntegralGlobalController extends BaseController +{ + @Autowired + private IIntegralGlobalService integralGlobalService; + + /** + * 查询奖励积分列表 + */ + @RequiresPermissions("system:globalIntegral:list") + @GetMapping("/list") + public TableDataInfo list(IntegralGlobal integralGlobal) + { + startPage(); + List list = integralGlobalService.selectIntegralGlobalList(integralGlobal); + return getDataTable(list); + } + + /** + * 导出奖励积分列表 + */ + @RequiresPermissions("system:globalIntegral:export") + @Log(title = "奖励积分", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, IntegralGlobal integralGlobal) + { + List list = integralGlobalService.selectIntegralGlobalList(integralGlobal); + ExcelUtil util = new ExcelUtil(IntegralGlobal.class); + util.exportExcel(response, list, "奖励积分数据"); + } + + /** + * 获取奖励积分详细信息 + */ + @RequiresPermissions("system:globalIntegral:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(integralGlobalService.selectIntegralGlobalById(id)); + } + + /** + * 新增奖励积分 + */ + @RequiresPermissions("system:globalIntegral:add") + @Log(title = "奖励积分", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody IntegralGlobal integralGlobal) + { + return toAjax(integralGlobalService.insertIntegralGlobal(integralGlobal)); + } + + /** + * 修改奖励积分 + */ + @RequiresPermissions("system:globalIntegral:edit") + @Log(title = "奖励积分", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody IntegralGlobal integralGlobal) + { + return toAjax(integralGlobalService.updateIntegralGlobal(integralGlobal)); + } + + /** + * 删除奖励积分 + */ + @RequiresPermissions("system:globalIntegral:remove") + @Log(title = "奖励积分", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(integralGlobalService.deleteIntegralGlobalByIds(ids)); + } +} diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IIntegralGlobalService.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IIntegralGlobalService.java new file mode 100644 index 0000000..5643ac6 --- /dev/null +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IIntegralGlobalService.java @@ -0,0 +1,62 @@ +package com.flossom.system.service; + +import com.flossom.hzMapper.domain.IntegralGlobal; + +import java.util.List; + +/** + * 奖励积分Service接口 + * + * @author flossom + * @date 2023-12-11 + */ +public interface IIntegralGlobalService +{ + /** + * 查询奖励积分 + * + * @param id 奖励积分主键 + * @return 奖励积分 + */ + public IntegralGlobal selectIntegralGlobalById(Long id); + + /** + * 查询奖励积分列表 + * + * @param integralGlobal 奖励积分 + * @return 奖励积分集合 + */ + public List selectIntegralGlobalList(IntegralGlobal integralGlobal); + + /** + * 新增奖励积分 + * + * @param integralGlobal 奖励积分 + * @return 结果 + */ + public int insertIntegralGlobal(IntegralGlobal integralGlobal); + + /** + * 修改奖励积分 + * + * @param integralGlobal 奖励积分 + * @return 结果 + */ + public int updateIntegralGlobal(IntegralGlobal integralGlobal); + + /** + * 批量删除奖励积分 + * + * @param ids 需要删除的奖励积分主键集合 + * @return 结果 + */ + public int deleteIntegralGlobalByIds(Long[] ids); + + /** + * 删除奖励积分信息 + * + * @param id 奖励积分主键 + * @return 结果 + */ + public int deleteIntegralGlobalById(Long id); +} diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/IntegralGlobalServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/IntegralGlobalServiceImpl.java new file mode 100644 index 0000000..4b1ec5e --- /dev/null +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/IntegralGlobalServiceImpl.java @@ -0,0 +1,101 @@ +package com.flossom.system.service.impl; + +import java.util.List; + +import com.flossom.common.core.utils.DateUtils; +import com.flossom.common.security.utils.SecurityUtils; +import com.flossom.hzMapper.domain.IntegralGlobal; +import com.flossom.hzMapper.mapper.IntegralGlobalMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.flossom.system.service.IIntegralGlobalService; + +/** + * 奖励积分Service业务层处理 + * + * @author flossom + * @date 2023-12-11 + */ +@Service +public class IntegralGlobalServiceImpl implements IIntegralGlobalService +{ + @Autowired + private IntegralGlobalMapper integralGlobalMapper; + + /** + * 查询奖励积分 + * + * @param id 奖励积分主键 + * @return 奖励积分 + */ + @Override + public IntegralGlobal selectIntegralGlobalById(Long id) + { + return integralGlobalMapper.selectIntegralGlobalById(id); + } + + /** + * 查询奖励积分列表 + * + * @param integralGlobal 奖励积分 + * @return 奖励积分 + */ + @Override + public List selectIntegralGlobalList(IntegralGlobal integralGlobal) + { + return integralGlobalMapper.selectIntegralGlobalList(integralGlobal); + } + + /** + * 新增奖励积分 + * + * @param integralGlobal 奖励积分 + * @return 结果 + */ + @Override + public int insertIntegralGlobal(IntegralGlobal integralGlobal) + { + integralGlobal.setCreateBy(SecurityUtils.getLoginUser().getUsername()); + integralGlobal.setCreateTime(DateUtils.getNowDate()); + return integralGlobalMapper.insertIntegralGlobal(integralGlobal); + } + + /** + * 修改奖励积分 + * + * @param integralGlobal 奖励积分 + * @return 结果 + */ + @Override + public int updateIntegralGlobal(IntegralGlobal integralGlobal) + { + integralGlobal.setUpdateBy(SecurityUtils.getLoginUser().getUsername()); + integralGlobal.setUpdateTime(DateUtils.getNowDate()); + integralGlobal.setUpdateTime(DateUtils.getNowDate()); + return integralGlobalMapper.updateIntegralGlobal(integralGlobal); + } + + /** + * 批量删除奖励积分 + * + * @param ids 需要删除的奖励积分主键 + * @return 结果 + */ + @Override + public int deleteIntegralGlobalByIds(Long[] ids) + { + return integralGlobalMapper.deleteIntegralGlobalByIds(ids); + } + + /** + * 删除奖励积分信息 + * + * @param id 奖励积分主键 + * @return 结果 + */ + @Override + public int deleteIntegralGlobalById(Long id) + { + return integralGlobalMapper.deleteIntegralGlobalById(id); + } +} diff --git a/flossom-ui/src/api/system/globalIntegral.js b/flossom-ui/src/api/system/globalIntegral.js new file mode 100644 index 0000000..2b7006f --- /dev/null +++ b/flossom-ui/src/api/system/globalIntegral.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询积分奖励列表 +export function listGlobal(query) { + return request({ + url: '/system/globalIntegral/list', + method: 'get', + params: query + }) +} + +// 查询积分奖励详细 +export function getGlobal(id) { + return request({ + url: '/system/globalIntegral/' + id, + method: 'get' + }) +} + +// 新增积分奖励 +export function addGlobal(data) { + return request({ + url: '/system/globalIntegral', + method: 'post', + data: data + }) +} + +// 修改积分奖励 +export function updateGlobal(data) { + return request({ + url: '/system/globalIntegral', + method: 'put', + data: data + }) +} + +// 删除积分奖励 +export function delGlobal(id) { + return request({ + url: '/system/globalIntegral/' + id, + method: 'delete' + }) +} diff --git a/flossom-ui/src/views/system/globalIntegral/index.vue b/flossom-ui/src/views/system/globalIntegral/index.vue new file mode 100644 index 0000000..51a11a3 --- /dev/null +++ b/flossom-ui/src/views/system/globalIntegral/index.vue @@ -0,0 +1,259 @@ + + +