From 3f857268a67947a4c95a490e75318161888e120c Mon Sep 17 00:00:00 2001 From: wangh <9483> Date: Tue, 9 Jan 2024 12:02:40 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/oilConfig/oilGun/list.vue | 4 +- .../src/views/oilConfig/oilPrice/index.vue | 35 +++-- .../oilConfig/oilPurchase/purchaseOrder.vue | 124 +++++++++++++++--- .../views/oilConfig/oilStatistics/list.vue | 10 +- fuintAdmin_zt/.env.development | 2 +- fuintAdmin_zt/src/main.js | 3 +- fuintAdmin_zt/src/views/Service/index.vue | 3 +- .../src/views/components/Service/index.vue | 6 +- .../mapper/OilPresetPricesMapper.java | 7 + .../mapper/xml/OilPresetPricesMapper.xml | 3 + .../impl/OilPresetPricesServiceImpl.java | 13 +- .../service/impl/OilTankServiceImpl.java | 22 ++-- .../store/mapper/xml/OilOrdersMapper.xml | 1 + .../store/service/impl/StoreServiceImpl.java | 11 +- .../service/impl/LJStoreServiceImpl.java | 1 + .../service/impl/QRCodeServiceImpl.java | 4 +- .../dept/controller/SysDeptController.java | 24 +--- .../system/dept/mapper/SysDeptMapper.java | 3 + .../system/dept/mapper/xml/SysDeptMapper.xml | 9 +- .../system/dept/service/ISysDeptService.java | 6 + .../dept/service/impl/SysDeptServiceImpl.java | 52 +++++++- .../src/main/resources/application.properties | 2 +- fuintCashierWeb/.env.development | Bin 289 -> 289 bytes gasStation-uni/pages/index/index.vue | 4 +- 24 files changed, 263 insertions(+), 86 deletions(-) diff --git a/fuintAdmin/src/views/oilConfig/oilGun/list.vue b/fuintAdmin/src/views/oilConfig/oilGun/list.vue index 586436345..48facfb6d 100644 --- a/fuintAdmin/src/views/oilConfig/oilGun/list.vue +++ b/fuintAdmin/src/views/oilConfig/oilGun/list.vue @@ -340,7 +340,8 @@ import {cleanTankApi} from "@/api/oilConfig/oilTank"; } .cardboxb{ position: absolute; - width: 50px; + /*width: 50px;*/ + width: auto; height: 20px; display: flex; align-items: center; @@ -349,6 +350,7 @@ import {cleanTankApi} from "@/api/oilConfig/oilTank"; font-size: 14px; left: 0px; bottom: 0px; + padding-right: 5px; background: #409eff; } diff --git a/fuintAdmin/src/views/oilConfig/oilPrice/index.vue b/fuintAdmin/src/views/oilConfig/oilPrice/index.vue index 500870c3e..e8628e73c 100644 --- a/fuintAdmin/src/views/oilConfig/oilPrice/index.vue +++ b/fuintAdmin/src/views/oilConfig/oilPrice/index.vue @@ -44,23 +44,27 @@ @@ -68,17 +72,20 @@ @@ -87,30 +94,33 @@ - - - - + @@ -336,6 +346,8 @@ type="datetime" placeholder="选择日期时间" style="width: 217px" + :default-value="defaultDateTime" + :picker-options="pickerOptions" value-format="yyyy-MM-dd HH:mm:ss"> @@ -383,7 +395,13 @@ import { return { - + defaultDateTime: new Date(), // 默认时间 + pickerOptions: { + disabledDate(time) { + // 限制选择范围为当前时间之后 + return time.getTime() < Date.now(); + }, + }, oilPresetPricesRules: { numberId:[ @@ -472,7 +490,8 @@ import { presetGbPrice:null , createTime:'', updateTime:'', - effectiveTime:null, + // effectiveTime:new date(), + effectiveTime:'', ifDelete:'', numberId:'', }, diff --git a/fuintAdmin/src/views/oilConfig/oilPurchase/purchaseOrder.vue b/fuintAdmin/src/views/oilConfig/oilPurchase/purchaseOrder.vue index e9331e728..5132a9456 100644 --- a/fuintAdmin/src/views/oilConfig/oilPurchase/purchaseOrder.vue +++ b/fuintAdmin/src/views/oilConfig/oilPurchase/purchaseOrder.vue @@ -58,7 +58,7 @@ - + + + + + @@ -170,7 +180,7 @@ - + @@ -179,7 +189,7 @@ - + @@ -188,7 +198,7 @@ - + @@ -222,7 +232,18 @@ import {getAuditPremApi} from "@/api/oilConfig/staff"; export default { name: "purchaseOrder", + data() { + var valiNumberPass = (rule, value, callback) => {//包含小数的数字 + let reg = /^[+-]?(0|([1-9]\d*))(\.\d{1,2})?$/; + if (value === '') { + callback(new Error('请输入内容')); + } else if (!reg.test(value)) { + callback(new Error('请输入数字,最多保留两位小数')); + } else { + callback(); + } + }; return { orderList:[], orderForm:{ @@ -240,6 +261,16 @@ export default { preInboundInventory: null, discountedPrice: null }, + + // 油罐文字提示 + tankVolume: 0, // 总升数 + nowVolume: 0, // 现有升数 + canUseVolume: 0,// 可用升数 + canUseT: 0,//吨数计算 + unit:'L',//单位 + // tTitle:'', + + purchaseId: null, numberInput: false, @@ -289,17 +320,13 @@ export default { // 表单校验 rules: { productDensity: [ - {required: true, message: "密度不能为空", trigger: "blur"}, - { type: 'number', message: '价格必须为数字值'} + { required: true, validator:valiNumberPass, trigger: "blur" } ], purchaseWeight: [ - {required: true, message: "重量不能为空", trigger: "blur"}, - { type: 'number', message: '价格必须为数字值'} + { required: true, validator:valiNumberPass, trigger: "blur" }, ], purchasePrice: [ - {required: true, message: "价格不能为空", trigger: "blur"}, - { type: 'number', message: '价格必须为数字值'} - + { required: true, validator:valiNumberPass, trigger: "blur" } ], numberId: [ {required: true, message: "请选择采购油品", trigger: "blur"} @@ -377,12 +404,17 @@ export default { await this.getList(); }, + computed: { + tTitle() { + // return "该油罐总容量"+this.tankVolume+' '+this.unit+",可用约" + this.canUseVolume+' '+this.unit +"-- 可用约"+this.canUseT+"吨" + return "油罐总容量"+this.tankVolume+' '+this.unit+"-- 可用约"+this.canUseT+"吨" + } + }, methods: { getList(){ this.loading = true; getPurchaseOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(response => { this.orderList = response.data.records; - console.log("this.tankList",this.orderList) this.total = response.data.total; // 总数计算 this.sumMethod(response.data.records); @@ -465,10 +497,12 @@ export default { "tankId": this.orderForm.tankId, "tankName": tankName.tankName, "totalAmount": this.orderForm.totalAmount, + "canUseT": this.canUseT, + } - + this.orderList.push(addFrom) this.open = false; this.sumMethod(this.orderList) @@ -497,7 +531,11 @@ export default { }, // 改变数字时 change(data) { - console.log() + + if (data.purchaseWeight > data.canUseT) { + this.$message('不能超过油罐储存的最大值!'); + data.purchaseWeight = data.canUseT + } // 密度计算 data.purchaseVolume = new BigNumber(data.purchaseWeight).times(1000).dividedBy(data.productDensity).toFixed(2); // 计算小计价格 @@ -532,9 +570,57 @@ export default { this.tankList.forEach(su=>{ if (data == su.id) { this.orderForm.productDensity = su.oilDensity + console.log("su",su) + this.tankVolume = su.tankVolume + this.nowVolume = su.storedQuantity + this.unit = su.unit + this.densityCalculations(); + // tankVolume:'0', // 总升数 + // nowVolume:'0', // 现有升数 + // canUseVolume:'0',// 可用升数 + // canUseT:'0',//吨数计算 + // unit:'L',//单位 + // } }) }, + // 根据升数计算密度 + densityCalculations() { + this.canUseVolume = this.tankVolume - this.nowVolume + // 定义油的体积和密度 + const volumeLiters = new BigNumber(this.canUseVolume); // 体积,单位:升 + const densityGramsPerML = new BigNumber(this.orderForm.productDensity); // 密度,单位:克/毫升 + + + // 计算油的质量(吨) + const massTons = volumeLiters.times(densityGramsPerML).times(1e-3).toFixed(2); + this.canUseT = massTons; // 将结果转换为数字类型并赋值给属性 + // console.log("canUseT",this.tankVolume) + + }, + inputPurchaseWeight() { + if (!this.orderForm.purchaseWeight) { + this.orderForm.purchaseWeight = '' + return + } + if (!this.canUseT) { + this.$message('请先选择油罐!'); + this.orderForm.purchaseWeight = '' + return + } + + + const purchaseWeight = parseFloat(this.orderForm.purchaseWeight); + const canUseT = parseFloat(this.canUseT); + console.log("purchaseWeight",purchaseWeight) + if (canUseT<=0) { + this.$message('已无可用吨数!'); + this.orderForm.purchaseWeight = '' + return + }else if (purchaseWeight>canUseT) { + this.orderForm.purchaseWeight = canUseT + } + }, // 查询所有的油品 getOilNameList() { let this_=this @@ -556,7 +642,6 @@ export default { this.suppliersList = response.data; }); }, - // 刷新订单编号 refresh() { var timestamp = new Date().getTime(); @@ -597,11 +682,11 @@ export default { purchaseDate : this.purchaseForm.purchaseDate, theDocumentAmount : this.totalAmountPurchased, } - + await unifiedProcessingApi({oilPurchase:from,oilPurchaseOrders:this.orderList}).then(res=>{ if (res.code === 200) { this.purchaseId = res.data.id - + this.$router.push({ path: '/oilConfig/oilPurchase/list'}); }else { return -1; @@ -644,7 +729,7 @@ export default { // }) // }) // } - + // 判断是新增还是修改 // if (this.queryParams.purchaseId < 0) { @@ -709,7 +794,6 @@ export default { this.voidFlag=true } }, - // 判断权限 async judgmentPermissions(data) { let fil ={ @@ -719,7 +803,6 @@ export default { return res.data }); }, - // 保存并审核 async audit(){ // 保存 @@ -822,7 +905,6 @@ export default { }, - // 页面跳转 goToAbout() { this.$router.push('/oilConfig/oilPurchase/list'); diff --git a/fuintAdmin/src/views/oilConfig/oilStatistics/list.vue b/fuintAdmin/src/views/oilConfig/oilStatistics/list.vue index bca511529..300c616a7 100644 --- a/fuintAdmin/src/views/oilConfig/oilStatistics/list.vue +++ b/fuintAdmin/src/views/oilConfig/oilStatistics/list.vue @@ -26,8 +26,8 @@ /> - - + +
- {{items.status=='qy'?'启用':'禁用'}} + 启用 + 禁用
diff --git a/fuintAdmin_zt/src/views/components/Service/index.vue b/fuintAdmin_zt/src/views/components/Service/index.vue index 22f3abb45..a75bfb88f 100644 --- a/fuintAdmin_zt/src/views/components/Service/index.vue +++ b/fuintAdmin_zt/src/views/components/Service/index.vue @@ -165,12 +165,16 @@ + + + @@ -448,7 +452,7 @@ enterThePetrolStation() { - if (this.from.status == 'jy') { + if (this.from.status === 'jy') { this.$message('该油站已被禁用'); return diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/OilPresetPricesMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/OilPresetPricesMapper.java index 722d1c0b2..38e74b1e2 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/OilPresetPricesMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/OilPresetPricesMapper.java @@ -21,6 +21,13 @@ public interface OilPresetPricesMapper extends BaseMapper { */ public IPage selectOilPresetPricesList(Page page, @Param("presetPrices") OilPresetPrices presetPrices); + + /** + * 将过期等待任务全部标为已失效 + * @return + */ + int editWaitByTime(); + /** * 根据id查询员工信息 * @param id diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilPresetPricesMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilPresetPricesMapper.xml index 9fe242be9..d8c30cc68 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilPresetPricesMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilPresetPricesMapper.xml @@ -100,5 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update oil_preset_prices set job_id = #{jobId} where preset_id = #{presetId} + + update oil_preset_prices set state = 'lose' where state = 'wait' and effective_time < now() + \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/impl/OilPresetPricesServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/impl/OilPresetPricesServiceImpl.java index a74d26f17..3868c0f05 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/impl/OilPresetPricesServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/impl/OilPresetPricesServiceImpl.java @@ -43,9 +43,19 @@ public class OilPresetPricesServiceImpl extends ServiceImpl selectOilPresetPricesList(Page page, OilPresetPrices presetPrices) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); presetPrices.setStoreId(nowAccountInfo.getStoreId()); + editWaitByTime(); + return baseMapper.selectOilPresetPricesList(page, presetPrices); } + /** + * 将过期等待任务全部标为已失效 + * @return + */ + public boolean editWaitByTime() { + return baseMapper.editWaitByTime()>0; + } + @Override public OilPresetPrices selectOilPresetPricesById(Integer id) { return baseMapper.selectOilPresetPricesById(id); @@ -66,8 +76,6 @@ public class OilPresetPricesServiceImpl extends ServiceImpl and (csi.store_name like concat('%',#{chainStoreInfo.storeName},'%') or ms.name like concat('%',#{chainStoreInfo.storeName},'%')) 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 d691553cb..7cc061a80 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 @@ -403,8 +403,8 @@ public class StoreServiceImpl extends ServiceImpl implem res.put(flag,false); return res; } -// if (redisTemplate.hasKey(flag)) { - if (true) { + if (redisTemplate.hasKey(flag)) { +// if (true) { // 找到站长的 Map param = new HashMap(); @@ -445,13 +445,8 @@ public class StoreServiceImpl extends ServiceImpl implem return res; } -// mtStoreMapper.getAccountByRole(12); - // 生成token - // 返回token - - -// redisTemplate.delete(flag); + redisTemplate.delete(flag); return res; } else { diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/LJStoreServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/LJStoreServiceImpl.java index 886586984..44b21eb7a 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/LJStoreServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/LJStoreServiceImpl.java @@ -128,6 +128,7 @@ public class LJStoreServiceImpl extends ServiceImpl impl // 查询店铺列表信息 QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("status","qy"); + queryWrapper.eq("if_delete","0"); queryWrapper.eq("chain_store_id",chainStoreId); List list = baseMapper.selectList(queryWrapper); double earthRadius = 6371; // 地球半径,单位为公里 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/QRCodeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/QRCodeServiceImpl.java index 2c9e0e669..7cad76c06 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/QRCodeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/QRCodeServiceImpl.java @@ -94,9 +94,9 @@ public class QRCodeServiceImpl extends ServiceImpl impleme if (ObjectUtil.isEmpty(qrCode1)){ qrCode.setStoreId(store.getId()); qrCode.setChainStoreId(store.getChainStoreId()); -// 带有店铺id 跳转首页 + // 带有店铺id 跳转首页 qrCode.setCollection("https://www.tuofeng.cc/oilIndex?storeId="+store.getChainStoreId()); -// 带有店铺id 跳转一键加油页面 + // 带有店铺id 跳转一键加油页面 qrCode.setPayment("https://www.tuofeng.cc/oilRefuel?storeId="+store.getChainStoreId()); row = baseMapper.insert(qrCode); IndexBanner indexBanner = new IndexBanner(); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/controller/SysDeptController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/controller/SysDeptController.java index f1b53fad5..57c580613 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/controller/SysDeptController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/controller/SysDeptController.java @@ -85,26 +85,6 @@ public class SysDeptController extends BaseController return getFailureResult("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); } int row = deptService.insertDept(dept); - SysDept sysDept = deptService.selectSysDeptByName(dept.getDeptName()); - if (ObjectUtil.isNotEmpty(sysDept)){ - LJStore store = storeService.selectStoreByDeptId(sysDept.getDeptId()); - QRCode qrCode = new QRCode(); - iqrCodeService.insertQRCode(qrCode,store.getId()); - LJUserGrade userGrade = new LJUserGrade(); - userGrade.setStoreId(store.getId()); - userGrade.setGrade(1); - userGrade.setName("普通会员"); - userGrade.setStatus("qy"); - userGrade.setGrowthValue(1); - userGrade.setPreferential("自定义优惠"); - userGrade.setGasolineDiscount("无优惠"); - userGrade.setGasolineRule("[{\"gasolineRule1\":1,\"gasolineRule2\":1,\"gasolineRule3\":1}]"); - userGrade.setDieselDiscount("无优惠"); - userGrade.setDieselRule("[{\"dieselRule1\":1,\"dieselRule2\":1,\"dieselRule3\":1}]"); - userGrade.setNaturalGasDiscount("无优惠"); - userGrade.setNaturalGasRule("[{\"naturalGas1\":1,\"naturalGas2\":1,\"naturalGas3\":1}]"); - userGradeService.insertUserGrade(userGrade,store.getId()); - } return getSuccessResult(row); } @@ -115,6 +95,7 @@ public class SysDeptController extends BaseController public ResponseObject edit(@Validated @RequestBody SysDept dept) { Long deptId = dept.getDeptId(); + Long parentId = dept.getParentId(); if (!deptService.checkDeptNameUnique(dept)) { return getFailureResult("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); @@ -127,6 +108,9 @@ public class SysDeptController extends BaseController { return getFailureResult("该部门包含未停用的子部门!"); } + else if (StringUtils.equals(UserConstants.DEPT_NORMAL, dept.getStatus()) && deptService.selectStatusByParentId(parentId) > 0) { + return getFailureResult("该部门的父级部门未启用!"); + } AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); dept.setCreateBy(nowAccountInfo.getId().toString()); return getSuccessResult(deptService.updateDept(dept)); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/SysDeptMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/SysDeptMapper.java index f07c9c0f5..3f973cb98 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/SysDeptMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/SysDeptMapper.java @@ -54,6 +54,9 @@ public interface SysDeptMapper extends BaseMapper */ public int selectNormalChildrenDeptById(Long deptId); + + int selectStatusByParentId(Long parentId); + /** * 是否存在子节点 * diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/xml/SysDeptMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/xml/SysDeptMapper.xml index e1f2f5c4e..3f6eee40d 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/xml/SysDeptMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/xml/SysDeptMapper.xml @@ -64,7 +64,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + update sys_dept set status = 'jy' where turnover_time > NOW() and turnoverType = 2 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/service/ISysDeptService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/service/ISysDeptService.java index 95e3b89fa..a749a3712 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/service/ISysDeptService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/service/ISysDeptService.java @@ -63,6 +63,12 @@ public interface ISysDeptService extends IService */ public int selectNormalChildrenDeptById(Long deptId); + /** + * 查询是否有父级部门未启用 + * @param parentId + * @return + */ + int selectStatusByParentId(Long parentId); /** * 是否存在部门子节点 * diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/service/impl/SysDeptServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/service/impl/SysDeptServiceImpl.java index 66f430b56..265ce6b59 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/service/impl/SysDeptServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/service/impl/SysDeptServiceImpl.java @@ -9,12 +9,19 @@ import com.fuint.business.store.entity.ChainStoreInfo; import com.fuint.business.store.entity.MtStore; import com.fuint.business.store.service.ChainStoreInfoService; import com.fuint.business.store.service.StoreService; +import com.fuint.business.storeInformation.entity.LJStore; +import com.fuint.business.storeInformation.entity.QRCode; +import com.fuint.business.storeInformation.service.ILJStoreService; +import com.fuint.business.storeInformation.service.IQRCodeService; +import com.fuint.business.userManager.entity.LJUserGrade; +import com.fuint.business.userManager.service.LJUserGradeService; import com.fuint.common.constant.UserConstants; import com.fuint.common.domain.TreeSelect; import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.Convert; import com.fuint.common.util.StringUtils; import com.fuint.common.util.TokenUtil; +import com.fuint.framework.exception.BusinessCheckException; import com.fuint.system.dept.entity.SysDept; import com.fuint.system.dept.mapper.SysDeptMapper; import com.fuint.system.dept.service.ISysDeptService; @@ -26,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; /** @@ -140,6 +148,16 @@ public class SysDeptServiceImpl extends ServiceImpl imple return baseMapper.selectNormalChildrenDeptById(deptId); } + /** + * 查询是否有父级部门未启用 + * @param parentId + * @return + */ + @Override + public int selectStatusByParentId(Long parentId) { + return baseMapper.selectStatusByParentId(parentId); + } + /** * 是否存在子节点 * @@ -192,7 +210,10 @@ public class SysDeptServiceImpl extends ServiceImpl imple return baseMapper.selectOne(queryWrapper); } - + @Autowired + private IQRCodeService iqrCodeService; + @Autowired + private LJUserGradeService userGradeService; /** * 新增保存部门信息 * @@ -228,6 +249,25 @@ public class SysDeptServiceImpl extends ServiceImpl imple store.setChainStoreId(chainStoreInfo.getId()); store.setContractDeptId(dept.getDeptId()); storeService.save(store); + + + QRCode qrCode = new QRCode(); + iqrCodeService.insertQRCode(qrCode,store.getId()); + LJUserGrade userGrade = new LJUserGrade(); + userGrade.setStoreId(store.getId()); + userGrade.setGrade(1); + userGrade.setName("普通会员"); + userGrade.setStatus("qy"); + userGrade.setGrowthValue(1); + userGrade.setPreferential("自定义优惠"); + userGrade.setGasolineDiscount("无优惠"); + userGrade.setGasolineRule("[{\"gasolineRule1\":1,\"gasolineRule2\":1,\"gasolineRule3\":1}]"); + userGrade.setDieselDiscount("无优惠"); + userGrade.setDieselRule("[{\"dieselRule1\":1,\"dieselRule2\":1,\"dieselRule3\":1}]"); + userGrade.setNaturalGasDiscount("无优惠"); + userGrade.setNaturalGasRule("[{\"naturalGas1\":1,\"naturalGas2\":1,\"naturalGas3\":1}]"); + userGradeService.insertUserGrade(userGrade,store.getId()); + }else { throw new Exception("数据有误,请联系管理员"); } @@ -269,6 +309,7 @@ public class SysDeptServiceImpl extends ServiceImpl imple * @return 结果 */ @Override + @Transactional public int updateDept(SysDept dept) { SysDept newParentDept = baseMapper.selectDeptById(dept.getParentId()); @@ -285,12 +326,17 @@ public class SysDeptServiceImpl extends ServiceImpl imple queryWrapper.eq(ChainStoreInfo::getContractDeptId,dept.getDeptId()); ChainStoreInfo chainStoreInfo = chainStoreService.getOne(queryWrapper); chainStoreInfo.setStoreName(dept.getDeptName()); + chainStoreInfo.setStatus(dept.getStatus()); chainStoreService.updateById(chainStoreInfo); }else if (dept.getDeptType().equals("3")){ LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); queryWrapper.eq(MtStore::getContractDeptId,dept.getDeptId()); MtStore store = storeService.getOne(queryWrapper); + if (ObjectUtil.isEmpty(store)) { + throw new RuntimeException("该油站不存在!"); + } store.setName(dept.getDeptName()); + store.setStatus(dept.getStatus()); storeService.updateById(store); } int result = baseMapper.updateById(dept); @@ -309,7 +355,9 @@ public class SysDeptServiceImpl extends ServiceImpl imple */ private void updateParentDeptStatusNormal(SysDept dept) { - baseMapper.updateDeptStatusNormal(dept.getAncestors()); + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(dept.getAncestors()).append(",").append(dept.getDeptId()); + baseMapper.updateDeptStatusNormal(stringBuilder.toString()); } /** diff --git a/fuintBackend/fuint-application/src/main/resources/application.properties b/fuintBackend/fuint-application/src/main/resources/application.properties index 1caed276c..ea3374b24 100644 --- a/fuintBackend/fuint-application/src/main/resources/application.properties +++ b/fuintBackend/fuint-application/src/main/resources/application.properties @@ -2,7 +2,7 @@ server.port=8008 env.profile=dev #env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/ -env.properties.path=D:/oil/oil/oilSystem/fuintBackend/configure/ +env.properties.path=D:/code/oilSystem/fuintBackend/configure/ diff --git a/fuintCashierWeb/.env.development b/fuintCashierWeb/.env.development index 65f43be4b73d4304ffec3d03f0c3696e2c501b2d..0c1d6d4a1a407c09a3fda577588e4bae517e1c77 100644 GIT binary patch delta 32 dcmZ3;w2)~7C!>V9g_VVYfrY+07Xvcj0sv!f1N;C0 delta 32 dcmZ3;w2)~7C!>Usp_PS!g@L|07Xvcj0svxN1MmO< diff --git a/gasStation-uni/pages/index/index.vue b/gasStation-uni/pages/index/index.vue index edf0c8149..ea3ca8cd8 100644 --- a/gasStation-uni/pages/index/index.vue +++ b/gasStation-uni/pages/index/index.vue @@ -70,8 +70,8 @@ {{oilInfo.oilPrice}} - 国际价 - {{oilInfo.oilPrice}} + 国标价 + {{oilInfo.gbPrice}}