From fe0ec44dffe05e971a1028ff685146e0cf24af5d Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Mon, 23 Oct 2023 15:03:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fuintAdmin/src/api/staff/user/fixinglevel.js | 44 + fuintAdmin/src/views/member/fixingLevel.vue | 812 ++++++++++++++++++ fuintAdmin/src/views/member/index.vue | 2 +- fuintAdmin/src/views/member/userInfo.vue | 5 +- .../controller/FixingLevelController.java | 78 ++ .../controller/LJUserGradeController.java | 2 +- .../userManager/entity/FixingLevel.java | 130 +++ .../userManager/mapper/FixingLevelMapper.java | 11 + .../mapper/xml/FixingLevelMapper.xml | 22 + .../service/FixingLevelService.java | 45 + .../service/impl/FixingLevelServiceImpl.java | 82 ++ 11 files changed, 1228 insertions(+), 5 deletions(-) create mode 100644 fuintAdmin/src/api/staff/user/fixinglevel.js create mode 100644 fuintAdmin/src/views/member/fixingLevel.vue create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/FixingLevelController.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/entity/FixingLevel.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/FixingLevelMapper.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/FixingLevelMapper.xml create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/FixingLevelService.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/FixingLevelServiceImpl.java diff --git a/fuintAdmin/src/api/staff/user/fixinglevel.js b/fuintAdmin/src/api/staff/user/fixinglevel.js new file mode 100644 index 000000000..4a082ddf4 --- /dev/null +++ b/fuintAdmin/src/api/staff/user/fixinglevel.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询固定等级列表 +export function listFixingLevel(query) { + return request({ + url: '/business/userManager/fixingLevel/list', + method: 'get', + params: query + }) +} + +// 查询固定等级详细 +export function getFixingLevel(id) { + return request({ + url: '/business/userManager/fixingLevel/' + id, + method: 'get' + }) +} + +// 新增固定等级 +export function addFixingLevel(data) { + return request({ + url: '/business/userManager/fixingLevel', + method: 'post', + data: data + }) +} + +// 修改固定等级 +export function updateFixingLevel(data) { + return request({ + url: '/business/userManager/fixingLevel', + method: 'put', + data: data + }) +} + +// 删除固定等级 +export function delFixingLevel(id) { + return request({ + url: '/business/userManager/fixingLevel/' + id, + method: 'delete' + }) +} diff --git a/fuintAdmin/src/views/member/fixingLevel.vue b/fuintAdmin/src/views/member/fixingLevel.vue new file mode 100644 index 000000000..678aef453 --- /dev/null +++ b/fuintAdmin/src/views/member/fixingLevel.vue @@ -0,0 +1,812 @@ + + + + + diff --git a/fuintAdmin/src/views/member/index.vue b/fuintAdmin/src/views/member/index.vue index d876169fe..a90818a8e 100644 --- a/fuintAdmin/src/views/member/index.vue +++ b/fuintAdmin/src/views/member/index.vue @@ -191,7 +191,7 @@
{{ scope.row.balance ? scope.row.balance.toFixed(2) : '0.00' }}
- + diff --git a/fuintAdmin/src/views/member/userInfo.vue b/fuintAdmin/src/views/member/userInfo.vue index a968b84b7..e0a854f00 100644 --- a/fuintAdmin/src/views/member/userInfo.vue +++ b/fuintAdmin/src/views/member/userInfo.vue @@ -949,7 +949,6 @@ export default { submitForm: function() { this.$refs["form"].validate(valid => { if (valid) { - console.log(this.form) if (this.form.id) { updateUser(this.form).then(response => { this.$modal.msgSuccess("修改成功"); @@ -980,10 +979,10 @@ export default { this.openConfirm = false; }, handleClick(tab, event) { - console.log(tab, event); + // console.log(tab, event); }, handleChange(value) { - console.log(value); + // console.log(value); }, // 返回 goBack() { diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/FixingLevelController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/FixingLevelController.java new file mode 100644 index 000000000..9c73e479c --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/FixingLevelController.java @@ -0,0 +1,78 @@ +package com.fuint.business.userManager.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fuint.business.userManager.entity.FixingLevel; +import com.fuint.business.userManager.service.FixingLevelService; +import com.fuint.framework.web.BaseController; +import com.fuint.framework.web.ResponseObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * 固定等级 controller层 + */ +@RestController +@RequestMapping("/business/userManager/fixingLevel") +public class FixingLevelController extends BaseController { + @Autowired + private FixingLevelService fixingLevelService; + + /** + * 根据条件分页查询固定等级信息 + * @param fixingLevel + * @param pageNo + * @param pageSize + * @return + */ + @GetMapping("/list") + public ResponseObject list(FixingLevel fixingLevel, + @RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){ + Page page =new Page(pageNo,pageSize); + IPage list = fixingLevelService.selectFixingLevelList(page,fixingLevel); + return getSuccessResult(list); + } + + /** + * 根据id查询固定等级信息 + * @param id + * @return + */ + @GetMapping("/{id}") + public ResponseObject staffInfo(@PathVariable Integer id){ + FixingLevel fixingLevel = fixingLevelService.selectFixingLevelById(id); + return getSuccessResult(fixingLevel); + } + + /** + * 删除固定等级信息 + * @return + */ + @DeleteMapping("/{id}") + public ResponseObject remove(@PathVariable Integer id){ + fixingLevelService.deleteFixingLevelById(id); + return getSuccessResult("操作成功"); + } + + /** + * 添加固定等级信息 + * @param fixingLevel + * @return + */ + @PostMapping + public ResponseObject add(@Validated @RequestBody FixingLevel fixingLevel){ + return getSuccessResult(fixingLevelService.insertFixingLevel(fixingLevel)); + } + + /** + * 修改固定等级信息 + * @param fixingLevel + * @return + */ + @PutMapping + public ResponseObject edit(@Validated @RequestBody FixingLevel fixingLevel){ + return getSuccessResult(fixingLevelService.updateFixingLevel(fixingLevel)); + } +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserGradeController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserGradeController.java index 1909521ce..7e04ef67d 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserGradeController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserGradeController.java @@ -47,7 +47,7 @@ public class LJUserGradeController extends BaseController { } /** - * 批量删除会员等级信息 + * 删除会员等级信息 * @return */ @DeleteMapping("/{id}") diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/entity/FixingLevel.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/entity/FixingLevel.java new file mode 100644 index 000000000..08b8996f4 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/entity/FixingLevel.java @@ -0,0 +1,130 @@ +package com.fuint.business.userManager.entity; + +import com.alibaba.fastjson2.JSONObject; +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 com.fuint.framework.entity.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Getter; +import lombok.Setter; + +import java.util.Date; +import java.io.Serializable; +import java.util.List; + +/** + * 固定等级表(Level)实体类 + * + */ +@Getter +@Setter +@TableName("fixing_level") +@ApiModel(value = "FixingLevel对象", description = "") +public class FixingLevel extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + @ApiModelProperty("自增ID") + @TableId(value = "ID", type = IdType.AUTO) + private Integer id; + /** + * 认证类型名称 + */ + @ApiModelProperty("认证类型名称") + private String name; + /** + * 优惠类型:自定义优惠;优惠活动组 + */ + @ApiModelProperty("优惠类型:自定义优惠;优惠活动组") + private String discountType; + /** + * 汽油优惠类型:无优惠,满减优惠,每升优惠 + */ + @ApiModelProperty("汽油优惠类型:无优惠,满减优惠,每升优惠") + private String gasolineDiscount; + /** + * 汽油优惠规则 + */ + @ApiModelProperty("汽油优惠规则") + private String gasolineRule; + /** + * 柴油优惠,无优惠,满减优惠,每升优惠 + */ + @ApiModelProperty("柴油优惠,无优惠,满减优惠,每升优惠") + private String dieselDiscount; + /** + * 柴油优惠规则 + */ + @ApiModelProperty("柴油优惠规则") + private String dieselRule; + /** + * 天然气优惠,无优惠,满减优惠,每单位优惠 + */ + @ApiModelProperty("天然气优惠,无优惠,满减优惠,每单位优惠") + private String naturalGasDiscount; + /** + * 天然气优惠规则 + */ + @ApiModelProperty("天然气优惠规则") + private String naturalGasRule; + /** + * 优惠活动组 + */ + @ApiModelProperty("优惠活动组") + private String promotionGroup; + /** + * 是否参与积分规则 + */ + @ApiModelProperty("是否参与积分规则") + private String pointRule; + /** + * 是否参与加油金规则 + */ + @ApiModelProperty("是否参与加油金规则") + private String refuelMoneyRule; + /** + * 是否参与成长值规则 + */ + @ApiModelProperty("是否参与成长值规则") + private String growthValueRule; + /** + * 是否参与优惠券规则 + */ + @ApiModelProperty("是否参与优惠券规则") + private String couponRule; + /** + * 是否参与储值优惠规则 + */ + @ApiModelProperty("是否参与储值优惠规则") + private String storeValue; + /** + * 是否需要审核 + */ + @ApiModelProperty("是否需要审核") + private String process; + /** + * 状态:启用,禁用 + */ + @ApiModelProperty("状态:启用,禁用") + private String status; + /** + * 二维码 + */ + @ApiModelProperty("二维码") + private String qrCode; + + @TableField(exist = false) + private List gasolineRuleList; + + @TableField(exist = false) + private List dieselRuleList; + + @TableField(exist = false) + private List naturalGasRuleList; +} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/FixingLevelMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/FixingLevelMapper.java new file mode 100644 index 000000000..f9910c4b7 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/FixingLevelMapper.java @@ -0,0 +1,11 @@ +package com.fuint.business.userManager.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fuint.business.userManager.entity.FixingLevel; +import org.apache.ibatis.annotations.Param; + +public interface FixingLevelMapper extends BaseMapper { + public IPage selectFixingLevelList(Page page, @Param("fixingLevel") FixingLevel fixingLevel); +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/FixingLevelMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/FixingLevelMapper.xml new file mode 100644 index 000000000..d4d8aaee6 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/FixingLevelMapper.xml @@ -0,0 +1,22 @@ + + + + + select * from fixing_level + + + + \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/FixingLevelService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/FixingLevelService.java new file mode 100644 index 000000000..359742d61 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/FixingLevelService.java @@ -0,0 +1,45 @@ +package com.fuint.business.userManager.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.fuint.business.userManager.entity.FixingLevel; + +/** + * 固定等级 业务层 + */ +public interface FixingLevelService extends IService { + /** + * 根据条件分页查询固定等级信息 + * @param page + * @return + */ + public IPage selectFixingLevelList(Page page, FixingLevel fixingLevel); + + /** + * 根据id查询固定等级信息 + * @param id + * @return + */ + public FixingLevel selectFixingLevelById(int id); + + /** + * 根据id删除固定等级信息 + * @param id + */ + public void deleteFixingLevelById(Integer id); + + /** + * 增加固定等级信息 + * @param fixingLevel + * @return + */ + public int insertFixingLevel(FixingLevel fixingLevel); + + /** + * 修改固定等级信息 + * @param fixingLevel + * @return + */ + public int updateFixingLevel(FixingLevel fixingLevel); +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/FixingLevelServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/FixingLevelServiceImpl.java new file mode 100644 index 000000000..7c5662e51 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/FixingLevelServiceImpl.java @@ -0,0 +1,82 @@ +package com.fuint.business.userManager.service.impl; + +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.fuint.business.userManager.entity.FixingLevel; +import com.fuint.business.userManager.entity.LJUserGrade; +import com.fuint.business.userManager.mapper.FixingLevelMapper; +import com.fuint.business.userManager.service.FixingLevelService; +import com.fuint.common.util.StringUtils; +import org.springframework.stereotype.Service; + +/** + * 固定等级信息 业务层 + */ +@Service +public class FixingLevelServiceImpl extends ServiceImpl implements FixingLevelService { + /** + * 根据条件分页查询固定等级信息 + * @param page + * @return + */ + @Override + public IPage selectFixingLevelList(Page page, FixingLevel fixingLevel) { + IPage fixingLevelIPage = baseMapper.selectFixingLevelList(page, fixingLevel); + for (FixingLevel record : fixingLevelIPage.getRecords()) { + if (StringUtils.isNotEmpty(record.getGasolineRule())){ + record.setGasolineRuleList(JSONArray.parseArray(record.getGasolineRule(), JSONObject.class)); + } + if (StringUtils.isNotEmpty(record.getDieselRule())){ + record.setDieselRuleList(JSONArray.parseArray(record.getDieselRule(), JSONObject.class)); + } + if (StringUtils.isNotEmpty(record.getNaturalGasRule())){ + record.setNaturalGasRuleList(JSONArray.parseArray(record.getNaturalGasRule(), JSONObject.class)); + } + } + return fixingLevelIPage; + } + + /** + * 根据id查询固定等级信息 + * @param id + * @return + */ + @Override + public FixingLevel selectFixingLevelById(int id) { + return baseMapper.selectById(id); + } + + /** + * 根据id删除固定等级信息 + * @param id + */ + @Override + public void deleteFixingLevelById(Integer id) { + baseMapper.deleteById(id); + } + + /** + * 增加固定等级信息 + * @param fixingLevel + * @return + */ + @Override + public int insertFixingLevel(FixingLevel fixingLevel) { + int row = baseMapper.insert(fixingLevel); + return row; + } + + /** + * 修改固定等级信息 + * @param fixingLevel + * @return + */ + @Override + public int updateFixingLevel(FixingLevel fixingLevel) { + int row = baseMapper.updateById(fixingLevel); + return row; + } +}