diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/controller/OilSuppliersController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/controller/OilSuppliersController.java index edbaa3a88..f1f3be3c2 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/controller/OilSuppliersController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/controller/OilSuppliersController.java @@ -80,7 +80,11 @@ public class OilSuppliersController extends BaseController { sysLog.setContent("新增油站供应商的数据信息"); sysLogService.saveVo(sysLog); }catch (Exception ignored){} - return getSuccessResult(this.oilSuppliersService.insert(oilSuppliers)); + int mm =this.oilSuppliersService.insert(oilSuppliers); + if(mm==1){ + return getFailureResult("供应商名称不能重复"); + } + return getSuccessResult(mm); } /** diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/OilSuppliersMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/OilSuppliersMapper.java index 7653d6fec..787db0c68 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/OilSuppliersMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/OilSuppliersMapper.java @@ -86,6 +86,14 @@ public interface OilSuppliersMapper { */ int deleteById(Integer id); + /** + * 通过名字查询油站信息 + * + * @param name + * @return + */ + List getSuppliersByName(String name); + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilSuppliersMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilSuppliersMapper.xml index 224aaa66f..f3afad2f4 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilSuppliersMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilSuppliersMapper.xml @@ -143,6 +143,10 @@ + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/OilSuppliersService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/OilSuppliersService.java index 6de628ffa..0775e3686 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/OilSuppliersService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/OilSuppliersService.java @@ -40,7 +40,7 @@ public interface OilSuppliersService { * @param oilSuppliers 实例对象 * @return 实例对象 */ - OilSuppliers insert(OilSuppliers oilSuppliers); + Integer insert(OilSuppliers oilSuppliers); /** * 修改数据 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/impl/OilSuppliersServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/impl/OilSuppliersServiceImpl.java index e0755dba1..30bd5e13d 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/impl/OilSuppliersServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/impl/OilSuppliersServiceImpl.java @@ -56,12 +56,16 @@ public class OilSuppliersServiceImpl implements OilSuppliersService { * @return 实例对象 */ @Override - public OilSuppliers insert(OilSuppliers oilSuppliers) { + public Integer insert(OilSuppliers oilSuppliers) { + List oilSuppliers1 =this.oilSuppliersDao.getSuppliersByName(oilSuppliers.getSupplierName()); + if(oilSuppliers1.size()>0){ + return 1; + } AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); oilSuppliers.setStoreId(nowAccountInfo.getStoreId()); oilSuppliers.setCreateBy(nowAccountInfo.getStaffId().toString()); this.oilSuppliersDao.insert(oilSuppliers); - return oilSuppliers; + return 0; } /** diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue index af9cb3724..78aa9d79f 100644 --- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue +++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue @@ -1057,8 +1057,6 @@ export default { // consumeAmount:this.consumeAmount, // // 屯油卡付款 // consumeRefuelMoney:this.consumeRefuelMoney.toFixed(2), - - }, // 打印商品支付后的订单 @@ -1080,13 +1078,10 @@ export default { } oilOrderR.push(o) }) - console.log("111111111111111111111111111") let goodsOrderR = [] if (this.goodsInfo) { this.goodsInfo.forEach(order => { - console.log("111111111111111111111111111") - let o = { oilName: order.name, unit: order.num + "" + order.unit, @@ -1095,8 +1090,6 @@ export default { goodsOrderR.push(o) }) } - - // 支付方式 const payTypeMap = { 'CASH': '现金',