diff --git a/fuintAdmin_zt/src/api/system/menu.js b/fuintAdmin_zt/src/api/system/menu.js index 343d6ba8d..505aa5106 100644 --- a/fuintAdmin_zt/src/api/system/menu.js +++ b/fuintAdmin_zt/src/api/system/menu.js @@ -26,6 +26,15 @@ export function treeselect(params) { }) } +// 查询菜单下拉树结构 +export function getButtonPermi(params) { + return request({ + url: 'backendApi/source/getButtonPermi', + method: 'get', + params: params + }) +} + // 根据角色ID查询菜单下拉树结构 export function roleMenuTreeselect(roleId) { return request({ diff --git a/fuintAdmin_zt/src/views/Site/index.vue b/fuintAdmin_zt/src/views/Site/index.vue index f5a56481a..b91db9cbe 100644 --- a/fuintAdmin_zt/src/views/Site/index.vue +++ b/fuintAdmin_zt/src/views/Site/index.vue @@ -99,6 +99,7 @@ type="warning" size="mini" @click="handleAdd" + v-hasPermi="['user:add']" >新增用户 @@ -162,19 +163,22 @@ type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" + v-hasPermi="['user:edit']" >修改 删除 - + 更多 - 重置密码 + 重置密码 @@ -619,7 +623,7 @@ - 保存 + 保存 @@ -725,6 +729,7 @@ size="mini" type="text" icon="el-icon-delete" + v-hasPermi="['role:delete']" @click="handleDelete1(scope.row)" >删除 @@ -937,7 +942,7 @@ import BigNumber from 'bignumber.js'; /*import node from "../../../../gasStation-uni/uni_modules/uview-ui/components/u-parse/node/node.vue";*/ import {dutyDelete, dutyEdit, dutyList, dutyLists} from "@/api/duty/duty"; import {addRole, delRole, getRole, updateRole} from "@/api/system/role"; -import {treeselect as menuTreeselect} from "@/api/system/menu"; +import {getButtonPermi, treeselect as menuTreeselect} from "@/api/system/menu"; @@ -986,6 +991,9 @@ export default { endTime:"", deleteid:0, pdinfo: 1 , + isAgencyAdd: false, + isAgencyEdit: false, + isAgencyDelete: false, activeName: 'list', ruleForm: { parentId:'', @@ -1243,9 +1251,31 @@ export default { this.handleClick() } + if (this.$route.fullPath) { + this.getPermi(this.$route.fullPath) + } + }, components: { Treeselect }, methods: { + // 获取权限信息 + getPermi(path){ + let _this = this; + getButtonPermi({path:path}).then(res => { + res.data.forEach(item => { + if (item.sourceCode == "agency:add"){ + _this.isAgencyAdd = true; + } + if (item.sourceCode == "agency:update"){ + _this.isAgencyEdit = true; + } + if (item.sourceCode == "agency:delete"){ + _this.isAgencyDelete = true; + } + }) + console.log(_this.isAgencyAdd,_this.isAgencyDelete,12223) + }) + }, // 修改角色类型 async changeMenu() { console.log(this.form1.roleType) @@ -1812,13 +1842,13 @@ export default {
{node.label} - {!isAdd ? + {!isAdd && this.isAgencyAdd ? < img alt="" src="https://www.youkerr.com/add" style=" width: 20px;height: 20px; " on-click={() => this.append(data)}/> : null } - {node.level !== 1 ? + {node.level !== 1 && this.isAgencyDelete ? < img alt="" src="https://www.youkerr.com/del" style=" width: 20px;height: 20px; " on-click={() => this.remove(node, data)}/> : null diff --git a/fuintAdmin_zt/src/views/components/Service/index.vue b/fuintAdmin_zt/src/views/components/Service/index.vue index 381bdd885..70bc25bed 100644 --- a/fuintAdmin_zt/src/views/components/Service/index.vue +++ b/fuintAdmin_zt/src/views/components/Service/index.vue @@ -17,8 +17,8 @@
{{from.name}}
-
编辑油站
-
进入油站
+
编辑油站
+
进入油站
diff --git a/fuintAdmin_zt/src/views/index.vue b/fuintAdmin_zt/src/views/index.vue index 9bb1565af..b92068e3d 100644 --- a/fuintAdmin_zt/src/views/index.vue +++ b/fuintAdmin_zt/src/views/index.vue @@ -201,7 +201,6 @@ export default { let nowDate = new Date(); let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000) this.value1 = [parseTime(oneWeekAgo),parseTime(nowDate)] - console.log("this.value1",this.value1) this.getStoreTotal() this.selectChildByDeptIdApi() this.getStoreAmount() diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/controller/PaymentRuleConfigController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/controller/PaymentRuleConfigController.java new file mode 100644 index 000000000..99e58cec5 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/controller/PaymentRuleConfigController.java @@ -0,0 +1,45 @@ +package com.fuint.api.fuyou.controller; + +import com.fuint.api.fuyou.entity.PaymentRuleConfig; +import com.fuint.api.fuyou.service.PaymentRuleConfigService; +import com.fuint.framework.web.BaseController; +import com.fuint.framework.web.ResponseObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/api/ruleConfig") +public class PaymentRuleConfigController extends BaseController { + @Autowired + private PaymentRuleConfigService paymentRuleConfigService; + + @GetMapping() + public ResponseObject getList(PaymentRuleConfig paymentRuleConfig){ + return getSuccessResult(paymentRuleConfigService.selectList(paymentRuleConfig)); + } + + @GetMapping("{id}") + public ResponseObject getInfo(@PathVariable Integer id){ + return getSuccessResult(paymentRuleConfigService.selectRuleById(id)); + } + + @PostMapping() + public ResponseObject add(PaymentRuleConfig paymentRuleConfig){ + return getSuccessResult(paymentRuleConfigService.addPaymentRuleConfig(paymentRuleConfig)); + } + + @PutMapping() + public ResponseObject edit(PaymentRuleConfig paymentRuleConfig){ + return getSuccessResult(paymentRuleConfigService.updatePaymentRuleConfig(paymentRuleConfig)); + } + + @DeleteMapping() + public ResponseObject delete(PaymentRuleConfig paymentRuleConfig){ + return getSuccessResult(paymentRuleConfigService.deletePaymentRuleConfig(paymentRuleConfig)); + } + + @PostMapping("enableRule") + public ResponseObject enablePaymentRuleConfig(PaymentRuleConfig paymentRuleConfig){ + return getSuccessResult(paymentRuleConfigService.enablePaymentRuleConfig(paymentRuleConfig)); + } +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/MerchantConfig.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/MerchantConfig.java index 2f0c57455..534f4bc60 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/MerchantConfig.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/MerchantConfig.java @@ -30,6 +30,10 @@ public class MerchantConfig extends BaseEntity implements Serializable { * 店铺id */ private Integer storeId; + /** + * 机构id + */ + private Integer deptId; /** * 机构号 */ diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/OilConfig.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/OilConfig.java index 4d6908c4a..a163212c6 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/OilConfig.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/OilConfig.java @@ -1,6 +1,7 @@ package com.fuint.api.fuyou.entity; 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; @@ -34,10 +35,22 @@ public class OilConfig extends BaseEntity implements Serializable { * 商户配置id */ private Integer merchConfigId; + /** + * 支付规则配置id + */ + private Integer ruleConfigId; + /** + * 交易类型:1、会员充值;2、便利店;3、积分商城;4、油品 + */ + private String transaction_type; /** * 交易占比 */ private Integer proportion; + /** + * 油号油枪id + */ + private String oilGunId; /** * 规则周期 */ @@ -50,6 +63,11 @@ public class OilConfig extends BaseEntity implements Serializable { * value值 */ private String valueStr; + /** + * 油号油枪名称 + */ + @TableField(exist = false) + private String oilGunName; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/PaymentRuleConfig.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/PaymentRuleConfig.java new file mode 100644 index 000000000..1acfba561 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/PaymentRuleConfig.java @@ -0,0 +1,82 @@ +package com.fuint.api.fuyou.entity; + +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.Data; + +import java.util.Date; +import java.io.Serializable; +import java.util.List; + +/** + * 支付规则配置表(PaymentRuleConfig)实体类 + * + * @author makejava + * @since 2024-07-16 14:47:13 + */ +@Data +@TableName("payment_rule_config") +@ApiModel(value = "PaymentRuleConfig", description = "支付规则配置表") +public class PaymentRuleConfig extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + @ApiModelProperty("自增ID") + @TableId(value = "ID", type = IdType.AUTO) + private Integer id; + /** + * 规则名称 + */ + private String ruleName; + /** + * 描述 + */ + private String description; + /** + * 规则类型:1、按比例分账;2、按交易类型分账 + */ + private String ruleType; + /** + * 油站id + */ + private Integer storeId; + /** + * 关联机构id + */ + private Integer deptId; + /** + * 规则状态:qy:启用;jy:禁用 + */ + private String status; + /** + * 开始时间 + */ + private Date startTime; + /** + * 创建时间 + */ + private Date createTime; + /** + * 更新时间 + */ + private Date updateTime; + /** + * 创建用户 + */ + private String createBy; + /** + * 修改用户 + */ + private String updateBy; + + @TableField(exist = false) + private List ruleList; +} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/mapper/PaymentRuleConfigMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/mapper/PaymentRuleConfigMapper.java new file mode 100644 index 000000000..a15f3929d --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/mapper/PaymentRuleConfigMapper.java @@ -0,0 +1,7 @@ +package com.fuint.api.fuyou.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.fuint.api.fuyou.entity.PaymentRuleConfig; + +public interface PaymentRuleConfigMapper extends BaseMapper { +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/MerchantConfigService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/MerchantConfigService.java index 90a241bbf..32be71dd8 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/MerchantConfigService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/MerchantConfigService.java @@ -52,6 +52,14 @@ public interface MerchantConfigService extends IService { */ public MerchantConfig selectMerchById(int id); + /** + * 根据商户号和店铺id查询商户配置信息 + * @param storeId + * @param mchntCd + * @return + */ + MerchantConfig selectByMchntCd(Integer storeId,String mchntCd); + /** * 将此店铺中所有的使用1改为0 */ diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/OilConfigService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/OilConfigService.java index 2be232fff..b15543525 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/OilConfigService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/OilConfigService.java @@ -60,4 +60,13 @@ public interface OilConfigService extends IService { * @param id */ public void delOilConfig(int id); + + /** + * 根据支付配置规则id查询配置列表信息 + * @param ruleId + * @return + */ + List selectListByRuleConfigId(Integer ruleId); + + void deleteOilConfigByRuleId(Integer ruleId); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/PaymentRuleConfigService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/PaymentRuleConfigService.java new file mode 100644 index 000000000..bdb956385 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/PaymentRuleConfigService.java @@ -0,0 +1,57 @@ +package com.fuint.api.fuyou.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.fuint.api.fuyou.entity.PaymentRuleConfig; + +import java.util.List; + +public interface PaymentRuleConfigService extends IService { + /** + * 查询列表信息 + * @param paymentRuleConfig + * @return + */ + List selectList(PaymentRuleConfig paymentRuleConfig); + + /** + * 根据id查询详情信息 + * @param id + * @return + */ + PaymentRuleConfig selectRuleById(Integer id); + + /** + * 根据id查询详情信息 + * @param name + * @return + */ + PaymentRuleConfig selectRuleByRuleName(String name,Integer storeId); + + /** + * 添加支付配置规则信息 + * @param ruleConfig + * @return + */ + int addPaymentRuleConfig(PaymentRuleConfig ruleConfig); + + /** + * 修改支付配置规则信息 + * @param ruleConfig + * @return + */ + int updatePaymentRuleConfig(PaymentRuleConfig ruleConfig); + + /** + * 删除支付配置规则信息 + * @param ruleConfig + * @return + */ + int deletePaymentRuleConfig(PaymentRuleConfig ruleConfig); + + /** + * 启用支付配置规则 + * @param ruleConfig + * @return + */ + int enablePaymentRuleConfig(PaymentRuleConfig ruleConfig); +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/MerchantConfigServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/MerchantConfigServiceImpl.java index bff7ed607..17f673886 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/MerchantConfigServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/MerchantConfigServiceImpl.java @@ -18,6 +18,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; import java.util.List; +import java.util.Objects; /** * 商户配置信息 业务层 @@ -94,6 +95,14 @@ public class MerchantConfigServiceImpl extends ServiceImpl(); + queryWrapper.eq("store_id",storeId); + queryWrapper.eq("mchnt_cd",mchntCd); + return baseMapper.selectOne(queryWrapper); + } + @Override public void updateMerchOrter(int storeId) { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -147,6 +156,10 @@ public class MerchantConfigServiceImpl extends ServiceImpl implements OilConfigService { @Autowired private MerchantConfigService merchantConfigService; + @Resource + private OilGunService oilGunService; @Override public void oilRule(Integer storeId) { @@ -156,4 +162,36 @@ public class OilConfigServiceImpl extends ServiceImpl selectListByRuleConfigId(Integer ruleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("rule_config_id",ruleId); + List oilConfigs = baseMapper.selectList(queryWrapper); + for (OilConfig oilConfig : oilConfigs) { + if (ObjectUtil.isNotEmpty(oilConfig.getOilGunId())) { + String[] split = oilConfig.getOilGunId().split(","); + String oilGunName = ""; + OilGun oilGun1 = new OilGun(); + oilGun1.setStoreId(oilConfig.getStoreId()); + List records = oilGunService.queryByPage(new Page(1, 10000), oilGun1).getRecords(); + for (OilGun record : records) { + for (String gunId : split) { + if (gunId.equals(record.getId())){ + oilGunName += record.getOilNumber() + "-" + record.getGunName() + ","; + } + } + } + oilConfig.setOilGunName(oilGunName); + } + } + return oilConfigs; + } + + @Override + public void deleteOilConfigByRuleId(Integer ruleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("rule_config_id",ruleId); + baseMapper.delete(queryWrapper); + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/PaymentRuleConfigServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/PaymentRuleConfigServiceImpl.java new file mode 100644 index 000000000..a877ce33e --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/PaymentRuleConfigServiceImpl.java @@ -0,0 +1,109 @@ +package com.fuint.api.fuyou.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.fuint.api.fuyou.entity.OilConfig; +import com.fuint.api.fuyou.entity.PaymentRuleConfig; +import com.fuint.api.fuyou.mapper.PaymentRuleConfigMapper; +import com.fuint.api.fuyou.service.OilConfigService; +import com.fuint.api.fuyou.service.PaymentRuleConfigService; +import com.fuint.api.fuyou.vo.OilConfigVo; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; + +@Service +public class PaymentRuleConfigServiceImpl extends ServiceImpl implements PaymentRuleConfigService { + + @Autowired + private OilConfigService oilConfigService; + + @Override + public List selectList(PaymentRuleConfig paymentRuleConfig) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("store_id",paymentRuleConfig.getStoreId()); + List list = baseMapper.selectList(queryWrapper); + for (PaymentRuleConfig ruleConfig : list) { + List oilConfigs = oilConfigService.selectListByRuleConfigId(ruleConfig.getId()); + ruleConfig.setRuleList(oilConfigs); + } + return list; + } + + @Override + public PaymentRuleConfig selectRuleById(Integer id) { + PaymentRuleConfig paymentRuleConfig = baseMapper.selectById(id); + if (ObjectUtil.isNotEmpty(paymentRuleConfig)){ + List oilConfigs = oilConfigService.selectListByRuleConfigId(id); + paymentRuleConfig.setRuleList(oilConfigs); + } + return paymentRuleConfig; + } + + @Override + public PaymentRuleConfig selectRuleByRuleName(String name,Integer storeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("store_id",storeId); + queryWrapper.eq("rule_name",name); + return baseMapper.selectOne(queryWrapper); + } + + @Override + public int addPaymentRuleConfig(PaymentRuleConfig ruleConfig) { + PaymentRuleConfig paymentRuleConfig = selectRuleByRuleName(ruleConfig.getRuleName(), ruleConfig.getStoreId()); + if (ObjectUtil.isNotEmpty(paymentRuleConfig)){ + return 0; + } + int row = baseMapper.insert(ruleConfig); + if (ObjectUtil.isNotEmpty(ruleConfig.getRuleList())){ + for (OilConfig oilConfig : ruleConfig.getRuleList()) { + OilConfigVo oilConfigVo = new OilConfigVo(); + BeanUtils.copyProperties(oilConfigVo,oilConfig); + oilConfigService.insertOilConfig(oilConfigVo); + } + } + return row; + } + + @Override + public int updatePaymentRuleConfig(PaymentRuleConfig ruleConfig) { + PaymentRuleConfig paymentRuleConfig = selectRuleByRuleName(ruleConfig.getRuleName(), ruleConfig.getStoreId()); + if (ObjectUtil.isNotEmpty(paymentRuleConfig) && !Objects.equals(paymentRuleConfig.getId(), ruleConfig.getId())){ + return 0; + } + int row = baseMapper.updateById(ruleConfig); + oilConfigService.deleteOilConfigByRuleId(ruleConfig.getId()); + if (ObjectUtil.isNotEmpty(ruleConfig.getRuleList())){ + for (OilConfig oilConfig : ruleConfig.getRuleList()) { + OilConfigVo oilConfigVo = new OilConfigVo(); + BeanUtils.copyProperties(oilConfigVo,oilConfig); + oilConfigService.insertOilConfig(oilConfigVo); + } + } + return row; + } + + @Override + public int deletePaymentRuleConfig(PaymentRuleConfig ruleConfig) { + int row = baseMapper.deleteById(ruleConfig); + oilConfigService.deleteOilConfigByRuleId(ruleConfig.getId()); + return row; + } + + @Override + public int enablePaymentRuleConfig(PaymentRuleConfig ruleConfig) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("store_id",ruleConfig.getStoreId()); + List list = baseMapper.selectList(queryWrapper); + for (PaymentRuleConfig paymentRuleConfig : list) { + paymentRuleConfig.setStatus("jy"); + baseMapper.updateById(paymentRuleConfig); + } + int row = baseMapper.updateById(ruleConfig); + return row; + } +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java index f31f89d5e..1444f5214 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java @@ -76,6 +76,8 @@ public class AllOrderInfoServiceImpl extends ServiceImpl getAmount(AllOrderInfoVo allOrderInfoVo) { Map map = new HashMap<>(); + + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + List sysDeptVos = deptService.selectChildByDeptId(nowAccountInfo.getDeptId()); + List ids = new ArrayList<>(); + + Integer tradeTotal = ObjectUtil.isNotEmpty(baseMapper.selectTotal(allOrderInfoVo)) ? baseMapper.selectTotal(allOrderInfoVo) : 0; Double tradeAmount = ObjectUtil.isNotEmpty(baseMapper.selectAllAmount(allOrderInfoVo)) ? baseMapper.selectAllAmount(allOrderInfoVo) : 0; allOrderInfoVo.setStatus("refund"); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/StoreService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/StoreService.java index 75997de33..efbe93881 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/StoreService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/StoreService.java @@ -7,6 +7,8 @@ import com.fuint.framework.exception.BusinessCheckException; import com.fuint.framework.pagination.PaginationRequest; import com.fuint.framework.pagination.PaginationResponse; import com.fuint.business.store.entity.MtStore; +import com.fuint.system.dept.vo.SysDeptVo; + import java.util.List; import java.util.Map; @@ -116,4 +118,6 @@ public interface StoreService extends IService { List> getByStroeName(MtStore storeName); Map getStoreTotal(LJStore store); + + List getStoreIds(List sysDeptVos); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/impl/StoreServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/impl/StoreServiceImpl.java index d84b8ec31..bf25be203 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/impl/StoreServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/impl/StoreServiceImpl.java @@ -32,6 +32,7 @@ import com.fuint.repository.model.TAccount; import com.fuint.system.dept.entity.SysDept; import com.fuint.system.dept.mapper.SysDeptMapper; import com.fuint.system.dept.service.ISysDeptService; +import com.fuint.system.dept.vo.SysDeptVo; import com.fuint.system.role.entity.TDuty; import com.fuint.system.role.mapper.TDutyMapper; import com.fuint.utils.StringUtil; @@ -649,6 +650,15 @@ public class StoreServiceImpl extends ServiceImpl implem return map; } + @Override + public List getStoreIds(List sysDeptVos) { + List ids = new ArrayList<>(); + for (SysDeptVo sysDeptVo : sysDeptVos) { + + } + return null; + } + // 将在部门里面删除的在油站中删除 public void beachDelStore() { diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/SourceServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/SourceServiceImpl.java index 9d3501b95..0db8ad1f0 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/SourceServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/SourceServiceImpl.java @@ -15,8 +15,10 @@ import com.fuint.repository.mapper.TSourceMapper; import com.fuint.repository.model.TSource; import com.fuint.common.domain.TreeNode; import com.fuint.framework.exception.BusinessCheckException; +import com.fuint.system.role.service.DutyService; import com.fuint.utils.ArrayUtil; import com.fuint.utils.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -35,6 +37,8 @@ public class SourceServiceImpl extends ServiceImpl imple @Resource private TSourceMapper tSourceMapper; + @Autowired + private DutyService tDutyService; /** * 获取有效的角色集合 @@ -48,14 +52,26 @@ public class SourceServiceImpl extends ServiceImpl imple @Override public List getButtonPermi(String path) { - List byStatusButton = null; + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + List checkedKeys = tDutyService.getSourceIdsByDutyId(Integer.valueOf(nowAccountInfo.getRoleIds())); + if (path.startsWith("/")) { + path = path.substring(1); + } + List byStatusButton = new ArrayList<>(); QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("path",path); queryWrapper.eq("status","A"); queryWrapper.eq("is_menu","1"); TSource tSource = baseMapper.selectOne(queryWrapper); if (ObjectUtil.isNotEmpty(tSource)){ - byStatusButton = tSourceMapper.findByStatusButton(tSource.getSourceId(), StatusEnum.ENABLED.getKey()); + List byStatusButton1 = tSourceMapper.findByStatusButton(tSource.getSourceId(), StatusEnum.ENABLED.getKey()); + for (TSource source : byStatusButton1) { + for (Long checkedKey : checkedKeys) { + if (checkedKey.compareTo(Long.valueOf(source.getSourceId()))==0){ + byStatusButton.add(source); + } + } + } } return byStatusButton; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendSourceController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendSourceController.java index 336e260e3..51cb12613 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendSourceController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendSourceController.java @@ -257,6 +257,12 @@ public class BackendSourceController extends BaseController { @Autowired private DutyService tDutyService; + + @GetMapping("/getButtonPermi") + public ResponseObject getButtonPermi(TSource tSource){ + return getSuccessResult(sourceService.getButtonPermi(tSource.getPath())); + } + /** * 获取菜单下拉树列表 * */