diff --git a/fuintAdmin/src/views/staffCommission/staffCommission.vue b/fuintAdmin/src/views/staffCommission/staffCommission.vue index 1fd975612..f9b93c223 100644 --- a/fuintAdmin/src/views/staffCommission/staffCommission.vue +++ b/fuintAdmin/src/views/staffCommission/staffCommission.vue @@ -286,7 +286,8 @@ - + @@ -730,9 +731,9 @@ export default { submitForm: function() { this.$refs["form"].validate(valid => { if (valid) { - if (/^\d+$/.test(this.form.royaltyRate)){ + // if (/^\d+$/.test(this.form.royaltyRate)){ this.form.royaltyRate = this.form.royaltyRate + this.select - } + // } this.form.staffRoleGroup = this.staffRoleGroup.toString() if (this.form.id) { updateCommission(this.form).then(response => { diff --git a/fuintAdmin/src/views/userGrade/index.vue b/fuintAdmin/src/views/userGrade/index.vue index 8c26451d7..1f64ffec2 100644 --- a/fuintAdmin/src/views/userGrade/index.vue +++ b/fuintAdmin/src/views/userGrade/index.vue @@ -1018,23 +1018,25 @@ export default { // 是否开启等级功能 getISEnableLevel(){ getChainStoreConfig().then(response => { - this.isEnableLevel = response.data.isEnableLevel; - this.clear = response.data.isMonthClear; - if (response.data.gasGrowthValue){ - this.gasGrowthValue = response.data.gasGrowthValue; - } - if (response.data.dieselGrowthValue) { - this.dieselGrowthValue = response.data.dieselGrowthValue; - } - if (response.data.naturalGrowthValue) { - this.naturalGrowthValue = response.data.naturalGrowthValue; - } - if (response.data.isEnableLevel=="no"){ - this.level1 = true; - this.level2 = false; - }else { - this.level1 = false; - this.level2 = true; + if (response.data) { + this.isEnableLevel = response.data.isEnableLevel; + this.clear = response.data.isMonthClear; + if (response.data.gasGrowthValue) { + this.gasGrowthValue = response.data.gasGrowthValue; + } + if (response.data.dieselGrowthValue) { + this.dieselGrowthValue = response.data.dieselGrowthValue; + } + if (response.data.naturalGrowthValue) { + this.naturalGrowthValue = response.data.naturalGrowthValue; + } + if (response.data.isEnableLevel == "no") { + this.level1 = true; + this.level2 = false; + } else { + this.level1 = false; + this.level2 = true; + } } }) // getSysConfig('is_enable_level').then(response => { @@ -1116,7 +1118,7 @@ export default { // 查询连锁店配置信息 getClearConfig(){ getChainStoreConfig().then(response => { - this.clear = response.data.levelClearRule; + if (response.data) this.clear = response.data.levelClearRule; }) }, // 修改清算规则 diff --git a/fuintAdmin_zt/src/views/components/Service/staff.vue b/fuintAdmin_zt/src/views/components/Service/staff.vue index ee7c38b69..d11095d3c 100644 --- a/fuintAdmin_zt/src/views/components/Service/staff.vue +++ b/fuintAdmin_zt/src/views/components/Service/staff.vue @@ -489,6 +489,7 @@ this.$refs["form"].validate(valid => { if (valid) { if (!this.form.id) { + this.form.storeId = this.id; this.form.posPrem = JSON.stringify(this.form.posPrem); this.form.appletPrem = JSON.stringify(this.form.appletPrem); addStaff(this.form).then(response => { diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java index 9c79b982f..ecb5ca082 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java @@ -1,5 +1,6 @@ package com.fuint.business.marketingActivity.activeExchange.service.impl; +import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -512,7 +513,8 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { } //折扣+优惠券 for (ActiveDiscountPayVO activeDiscountPayVO : activeDiscountVOList) { - if (!activeDiscountPayVO.getParticipationCondition().equals("1")){ + if (ObjectUtil.isNotEmpty(activeDiscountPayVO.getParticipationCondition()) + && !activeDiscountPayVO.getParticipationCondition().equals("1")){ for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) { if(StringUtils.isNotEmpty(cardFavorableRecordVO.getExclusiveFunction()) && cardFavorableRecordVO.getExclusiveFunction().equals("2") && StringUtils.isNotEmpty(cardFavorableRecordVO.getExclusiveFunction()) && !cardFavorableRecordVO.getExclusiveFunction().equals("0")){ @@ -553,7 +555,8 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { } //满减+优惠券 for (ActiveDiscountPayVO activeDiscountPayVO : activeFuletVOList) { - if (!activeDiscountPayVO.getParticipationCondition().equals("1")){ + if (ObjectUtils.isNotEmpty(activeDiscountPayVO.getParticipationCondition()) + && !activeDiscountPayVO.getParticipationCondition().equals("1")){ for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) { if(StringUtils.isNotEmpty(cardFavorableRecordVO.getExclusiveFunction()) && ObjectUtils.isNotEmpty(cardFavorableRecordVO) && cardFavorableRecordVO.getType().equals("2") && !cardFavorableRecordVO.getExclusiveFunction().equals("0")){ ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO(); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeOneCoupon/entity/ActiveOneCoupon.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeOneCoupon/entity/ActiveOneCoupon.java index 1c2e22444..e5323c305 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeOneCoupon/entity/ActiveOneCoupon.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeOneCoupon/entity/ActiveOneCoupon.java @@ -1,6 +1,9 @@ package com.fuint.business.marketingActivity.activeOneCoupon.entity; import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.extension.activerecord.Model; import lombok.Data; @@ -16,6 +19,7 @@ import java.io.Serializable; @Data public class ActiveOneCoupon extends Model { //主键id + @TableId(type = IdType.AUTO) private Integer id; private Integer storeId; private String activeName; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeOneCoupon/service/impl/ActiveOneCouponServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeOneCoupon/service/impl/ActiveOneCouponServiceImpl.java index be3b54008..d83b50c42 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeOneCoupon/service/impl/ActiveOneCouponServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeOneCoupon/service/impl/ActiveOneCouponServiceImpl.java @@ -28,6 +28,7 @@ import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.TokenUtil; import com.fuint.repository.mapper.MtUserGradeMapper; import com.fuint.repository.model.MtUserGrade; +import com.fuint.repository.model.MtUserGradeVO; import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -73,11 +74,11 @@ public class ActiveOneCouponServiceImpl extends ServiceImpl map){ String mobile = map.get("mobile"); - LJStaff staff = mtStaffService.selectStaffByMobile(mobile); + LJStaff staff = mtStaffService.selectStaffByMobile(mobile,null); return getSuccessResult(staff); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/ILJStaffService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/ILJStaffService.java index f1eb87a4a..7f4eb13df 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/ILJStaffService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/ILJStaffService.java @@ -54,7 +54,7 @@ public interface ILJStaffService extends IService { * @param mobile * @return */ - public LJStaff selectStaffByMobile(String mobile); + public LJStaff selectStaffByMobile(String mobile,Integer storeId); public LJStaff selectStaffByMobile2(String mobile); /** diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java index f6366f9ae..373dab7dc 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java @@ -19,6 +19,8 @@ import com.fuint.common.util.TokenUtil; import com.fuint.framework.web.ResponseObject; import com.fuint.module.backendApi.controller.BackendFileController; import com.fuint.repository.model.TAccount; +import com.fuint.system.role.entity.TDuty; +import com.fuint.system.role.service.DutyService; import com.fuint.utils.Digests; import com.fuint.utils.Encodes; import jdk.nashorn.internal.parser.Token; @@ -28,6 +30,7 @@ import org.springframework.mock.web.MockMultipartFile; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.io.*; import java.text.SimpleDateFormat; @@ -45,6 +48,8 @@ public class LJStaffServiceImpl extends ServiceImpl impl private AccountService accountService; @Autowired private QrCodeUtils qrCodeUtils; + @Resource + private DutyService tDutyService; /** * 根据条件分页查询员工信息 @@ -126,11 +131,14 @@ public class LJStaffServiceImpl extends ServiceImpl impl * @return */ @Override - public LJStaff selectStaffByMobile(String mobile) { - AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + public LJStaff selectStaffByMobile(String mobile,Integer storeId) { + if (ObjectUtil.isEmpty(storeId)){ + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + storeId = nowAccountInfo.getStoreId(); + } QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.eq("mobile",mobile); - queryWrapper.eq("store_id",nowAccountInfo.getStoreId()); + queryWrapper.eq("store_id",storeId); queryWrapper.eq("if_delete","0"); LJStaff staff = baseMapper.selectOne(queryWrapper); return staff; @@ -176,19 +184,19 @@ public class LJStaffServiceImpl extends ServiceImpl impl */ @Override public int insertStaff(LJStaff staff) { - LJStaff staff2 = this.selectStaffByMobile(staff.getMobile()); - if (ObjectUtil.isNotEmpty(staff2)) return 0; AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); Integer storeId = nowAccountInfo.getStoreId(); if (ObjectUtil.isNotEmpty(staff.getStoreId())) { storeId = staff.getStoreId(); } + LJStaff staff2 = this.selectStaffByMobile(staff.getMobile(),storeId); + if (ObjectUtil.isNotEmpty(staff2)) return 0; staff.setStoreId(storeId); if (StringUtils.isNotEmpty(staff.getRefundPassword())){ this.entryptPassword(staff); } int row = baseMapper.insert(staff); - LJStaff staff1 = this.selectStaffByMobile(staff.getMobile()); + LJStaff staff1 = this.selectStaffByMobile(staff.getMobile(),storeId); if (ObjectUtil.isNotEmpty(staff1)){ // 添加员工码 staff1.setStaffCode("https://www.tuofeng.cc/oilRefuel?storeId="+storeId+"&staffId="+staff1.getId()); @@ -221,15 +229,16 @@ public class LJStaffServiceImpl extends ServiceImpl impl }else { account.setPassword("123456"); } - - accountService.createAccountInfo(account,null); + TDuty tDuty = new TDuty(); + tDuty.setDutyId(Integer.valueOf(staff1.getRoleId())); + accountService.createAccountInfo(account,tDutyService.getDutyList(tDuty)); return row; } @Override public int addStaff(LJStaff staff,TAccount tAccount) { int row = baseMapper.insert(staff); - LJStaff staff1 = this.selectStaffByMobile(staff.getMobile()); + LJStaff staff1 = this.selectStaffByMobile(staff.getMobile(),null); if (ObjectUtil.isNotEmpty(staff1)){ tAccount.setStaffId(staff1.getId()); accountService.updateAccount(tAccount); @@ -245,8 +254,8 @@ public class LJStaffServiceImpl extends ServiceImpl impl @Override public int updateStaff(LJStaff staff) { int row = 0; - LJStaff staff1 = this.selectStaffByMobile(staff.getMobile()); - if (ObjectUtil.isNotEmpty(staff1) && staff1.getId() != staff.getId()){ + LJStaff staff1 = this.selectStaffByMobile(staff.getMobile(),staff.getStoreId()); + if (ObjectUtil.isNotEmpty(staff1) && !staff1.getId().equals(staff.getId())){ row = 0; return row; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/MtUserGradeChildServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/MtUserGradeChildServiceImpl.java index 9542a2a8e..f35cbbb6b 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/MtUserGradeChildServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/MtUserGradeChildServiceImpl.java @@ -48,17 +48,19 @@ public class MtUserGradeChildServiceImpl extends ServiceImpl(); + if (ObjectUtil.isNotEmpty(chainStoreConfig)) { + String isEnableLevel = chainStoreConfig.getIsEnableLevel(); + if (isEnableLevel.equals("yes")) { + if (ObjectUtil.isNotEmpty(userVo.getGradeId())) { + LJUserGrade ljUserGrade = ljUserGradeService.selectUserGradeById(userVo.getGradeId()); + if (!ljUserGrade.getIfRechargeCoupon().equals("1")) { + return new ArrayList(); + } + } else { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("user_grade_id", userVo.getGradeId()); + return baseMapper.selectList(queryWrapper); } - }else{ - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("user_grade_id",userVo.getGradeId()); - return baseMapper.selectList(queryWrapper); } } return new ArrayList(); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/role/service/impl/DutyServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/role/service/impl/DutyServiceImpl.java index e53aabba4..7e903f9bd 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/system/role/service/impl/DutyServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/role/service/impl/DutyServiceImpl.java @@ -285,6 +285,9 @@ public class DutyServiceImpl extends ServiceImpl implements if (ObjectUtil.isNotEmpty(tDuty) && ObjectUtil.isNotEmpty(tDuty.getPermissionType())) { lambdaQueryWrapper.like(TDuty::getPermissionType,tDuty.getPermissionType()); } + if (ObjectUtil.isNotEmpty(tDuty) && ObjectUtil.isNotEmpty(tDuty.getDutyId())) { + lambdaQueryWrapper.eq(TDuty::getDutyId,tDuty.getDutyId()); + } return baseMapper.selectList(lambdaQueryWrapper); } diff --git a/fuintBackend/fuint-repository/src/main/java/com/fuint/repository/mapper/MtUserGradeMapper.java b/fuintBackend/fuint-repository/src/main/java/com/fuint/repository/mapper/MtUserGradeMapper.java index 86849a492..087f34466 100644 --- a/fuintBackend/fuint-repository/src/main/java/com/fuint/repository/mapper/MtUserGradeMapper.java +++ b/fuintBackend/fuint-repository/src/main/java/com/fuint/repository/mapper/MtUserGradeMapper.java @@ -2,6 +2,7 @@ package com.fuint.repository.mapper; import com.fuint.repository.model.MtUserGrade; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.fuint.repository.model.MtUserGradeVO; /** * Mapper 接口 @@ -10,5 +11,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; * CopyRight https://www.fuint.cn */ public interface MtUserGradeMapper extends BaseMapper { + + MtUserGradeVO selectByGradeId(Integer gradeId); // empty } diff --git a/fuintBackend/fuint-repository/src/main/java/com/fuint/repository/model/MtUserGrade.java b/fuintBackend/fuint-repository/src/main/java/com/fuint/repository/model/MtUserGrade.java index e5114ba46..ea4daeecf 100644 --- a/fuintBackend/fuint-repository/src/main/java/com/fuint/repository/model/MtUserGrade.java +++ b/fuintBackend/fuint-repository/src/main/java/com/fuint/repository/model/MtUserGrade.java @@ -38,9 +38,9 @@ public class MtUserGrade implements Serializable { @ApiModelProperty("等级名称") private String name; -// @ApiModelProperty("升级会员等级条件描述") +/*// @ApiModelProperty("升级会员等级条件描述") // private String catchCondition; - +*/ @ApiModelProperty("升级会员等级条件,init:默认获取;pay:付费升级;frequency:消费次数;amount:累积消费金额升级") @TableField(exist = false) private String catchType; diff --git a/fuintBackend/fuint-repository/src/main/java/com/fuint/repository/model/MtUserGradeVO.java b/fuintBackend/fuint-repository/src/main/java/com/fuint/repository/model/MtUserGradeVO.java new file mode 100644 index 000000000..9d9abf204 --- /dev/null +++ b/fuintBackend/fuint-repository/src/main/java/com/fuint/repository/model/MtUserGradeVO.java @@ -0,0 +1,18 @@ +package com.fuint.repository.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class MtUserGradeVO { + @TableId(value = "ID", type = IdType.AUTO) + private Integer id; + + @ApiModelProperty("等级") + private Integer grade; + + @ApiModelProperty("等级名称") + private String name; +} diff --git a/fuintBackend/fuint-repository/src/main/resources/mapper/MtUserGradeMapper.xml b/fuintBackend/fuint-repository/src/main/resources/mapper/MtUserGradeMapper.xml index ace48db9e..272a4983f 100644 --- a/fuintBackend/fuint-repository/src/main/resources/mapper/MtUserGradeMapper.xml +++ b/fuintBackend/fuint-repository/src/main/resources/mapper/MtUserGradeMapper.xml @@ -2,4 +2,7 @@ + diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue index 7a25f5244..5f91d37b7 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue @@ -90,7 +90,7 @@
-¥{{ fullReduction.toFixed(2) }}
-
+
加油员
-
{{ staff.realName }}
+
{{ staff ? staff.realName : "--" }}
@@ -345,13 +345,16 @@ :visible.sync="dialogVisible" width="30%" :close-on-click-modal="false"> -
+
{{ item.realName }}
{{ item.mobile }}
+
+
+ 暂未配置加油员
关 闭 @@ -1626,7 +1629,7 @@ this.getOilName(); this.getGoods(); // this.getStaffList(); - this.getStaff(); + // this.getStaff(); this.getList(); this.getCouponList(); // this.getUnitList(); @@ -1760,7 +1763,8 @@ }, // 会员充值 async userRecharge() { - if (this.isSure){ + // if (this.isSure){ + if (this.member){ this.$message.error("请先选择会员") return; } @@ -2557,7 +2561,9 @@ this.map.consumeAmount = 0.0; this.map.refuelMoney = JSON.stringify(this.refuelMoney) this.map.couponId = this.useCouponIds - this.map.staffId = this.staff.id + if (this.staff){ + this.map.staffId = this.staff.id + } this.map.cardFavorableId = this.cardFavorableId this.map.recordId = this.recordId this.map.userId = this.member.id @@ -2855,6 +2861,7 @@ resetMember(){ this.member = {}; this.isMember = false; + this.isSure = false; this.map.payUser == ""; this.balance = 0; this.oilDiscount = 0; @@ -3569,7 +3576,7 @@ this.dialogVisiblej = true - this.getStaff() + // this.getStaff() }, // 重置油品订单 resetting(){ @@ -3826,6 +3833,7 @@ this.amount = 0 this.dialogVisibleamount = true; let result = false + this.isExistOilOrder = false; // 判断是否存在此油品的数据 this.oilOrder.forEach(item => { if (item.id==data.id){ @@ -3887,7 +3895,9 @@ this.updateRefuelMoney(); this.map.refuelMoney = JSON.stringify(this.refuelMoney) this.map.couponId = this.useCouponIds - this.map.staffId = this.staff.id + if (this.staff) { + this.map.staffId = this.staff.id + } this.map.cardFavorableId = this.cardFavorableId this.map.recordId = this.recordId this.map.userId = this.member.id @@ -3984,6 +3994,7 @@ _this.oilTotal = 0; _this.goodsTotal = 0; _this.isMember = false; + _this.isSure = false; _this.oilOrder = [] _this.goodsOrder = [] _this.amount = 0