diff --git a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/oilTypeInAndOutBound/oilTypeInAndOutBound.js b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/oilTypeInAndOutBound/oilTypeInAndOutBound.js index b27571cd..9c82e36c 100644 --- a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/oilTypeInAndOutBound/oilTypeInAndOutBound.js +++ b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/oilTypeInAndOutBound/oilTypeInAndOutBound.js @@ -13,6 +13,14 @@ export default { }) }, + // 获取油罐by Sid + tankLisBySid: function(sid) { + return request({ + url: '/cyf/tankinfo/listByType/' + sid + }) + }, + + // 入库 logPagerList: function(params) { diff --git a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/portal/Upload.js b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/portal/Upload.js new file mode 100644 index 00000000..76bd232a --- /dev/null +++ b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/portal/Upload.js @@ -0,0 +1,30 @@ +import request from '@/utils/request' +import qs from 'qs' +// 统一请求路径前缀 +const base = process.env.VUE_APP_URL + +// 文件上传接口 +export const uploadFile = '/api/file/upload' +// export const uploadFile = process.env.VUE_APP_BASE_API + '/customer/file/upload' + + + +// 上传图片 +// export function imageUpload(data) { +// return request({ +// url: '/portal/file/upload', +// method: 'post', +// data, +// headers: { 'Content-Type': 'multipart/form-data' } +// }) +// } + +// 移除图片 +export function deleteFilesOss(data) { + return request({ + url: '/base/v1/baseVehicleAppendixs/deleteFilesOss', + method: 'post', + data: qs.stringify(data), + // headers: { 'Content-Type': 'multipart/form-data' } + }) +} diff --git a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/components/uploadFile/upload_yanchejianchaTuBiao.vue b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/components/uploadFile/upload_yanchejianchaTuBiao.vue index b7c1089a..a3b9a453 100644 --- a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/components/uploadFile/upload_yanchejianchaTuBiao.vue +++ b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/components/uploadFile/upload_yanchejianchaTuBiao.vue @@ -1,222 +1,226 @@ diff --git a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/layout/components/Sidebar/index.vue b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/layout/components/Sidebar/index.vue index 1f6cfabc..d4bfae18 100644 --- a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/layout/components/Sidebar/index.vue +++ b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/layout/components/Sidebar/index.vue @@ -137,20 +137,20 @@ component: 'index', meta: { icon: "el-icon-help", - title: "原料类型" + title: "物料类型" }, - name: "/baseInfo/rawMaterialType", - path: "/baseInfo/rawMaterialType", + name: "/baseInfo/materialType", + path: "/baseInfo/materialType", }, { alwaysShow: true, component: 'index', meta: { icon: "el-icon-help", - title: "原料信息" + title: "物料信息" }, - name: "/baseInfo/rawMaterialInfo", - path: "/baseInfo/rawMaterialInfo", + name: "/baseInfo/materialInfo", + path: "/baseInfo/materialInfo", }, { alwaysShow: true, diff --git a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/router/index.js b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/router/index.js index 0a0d5d9b..50af25c6 100644 --- a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/router/index.js +++ b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/router/index.js @@ -52,21 +52,21 @@ export const constantRoutes = [{ title: '基础信息' }, children: [{ - path: '/baseInfo/rawMaterialType', + path: '/baseInfo/materialType', component: () => - import('@/views/baseInfo/rawMaterialType/index.vue'), + import('@/views/baseInfo/materialType/index.vue'), name: 'index', meta: { - title: '原料类型' + title: '物料类型' } }, { - path: '/baseInfo/rawMaterialInfo', + path: '/baseInfo/materialInfo', component: () => - import('@/views/baseInfo/rawMaterialInfo/index.vue'), + import('@/views/baseInfo/materialInfo/index.vue'), name: 'index', meta: { - title: '原料信息' + title: '物料信息' } }, { diff --git a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/rawMaterialInfo/index.vue b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/materialInfo/index.vue similarity index 97% rename from yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/rawMaterialInfo/index.vue rename to yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/materialInfo/index.vue index 018e5a6f..690e6eec 100644 --- a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/rawMaterialInfo/index.vue +++ b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/materialInfo/index.vue @@ -41,7 +41,7 @@ - + @@ -66,7 +66,7 @@ import Pagination from '@/components/pagination' import pageye from '@/components/pagination/pageye' import ButtonBar from '@/components/ButtonBar' - import rawMaterialInfoAdd from './rawMaterialInfoAdd.vue' + import materialInfoAdd from './materialInfoAdd.vue' // import oilTypeInfo from './oilTypeInfo.vue' export default { name: 'CustomerManagement', @@ -74,7 +74,7 @@ Pagination, pageye, ButtonBar, - rawMaterialInfoAdd, + materialInfoAdd, // oilTypeInfo, }, diff --git a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/rawMaterialInfo/rawMaterialInfoAdd.vue b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/materialInfo/materialInfoAdd.vue similarity index 100% rename from yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/rawMaterialInfo/rawMaterialInfoAdd.vue rename to yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/materialInfo/materialInfoAdd.vue diff --git a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/rawMaterialType/index.vue b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/materialType/index.vue similarity index 91% rename from yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/rawMaterialType/index.vue rename to yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/materialType/index.vue index a6120451..c1977070 100644 --- a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/rawMaterialType/index.vue +++ b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/materialType/index.vue @@ -1,14 +1,14 @@ - - - + + +
@@ -45,7 +45,7 @@
- + @@ -55,7 +55,7 @@ import Pagination from '@/components/pagination' import pageye from '@/components/pagination/pageye' import ButtonBar from '@/components/ButtonBar' - import rawMaterialTypeAdd from './rawMaterialTypeAdd.vue' + import materialTypeAdd from './materialTypeAdd.vue' // import oilTypeInfo from './oilTypeInfo.vue' export default { name: 'CustomerManagement', @@ -63,7 +63,7 @@ Pagination, pageye, ButtonBar, - rawMaterialTypeAdd, + materialTypeAdd, // oilTypeInfo, }, diff --git a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/rawMaterialType/rawMaterialTypeAdd.vue b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/materialType/materialTypeAdd.vue similarity index 86% rename from yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/rawMaterialType/rawMaterialTypeAdd.vue rename to yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/materialType/materialTypeAdd.vue index 4ce98ed6..f9fa5e6a 100644 --- a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/rawMaterialType/rawMaterialTypeAdd.vue +++ b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/materialType/materialTypeAdd.vue @@ -3,7 +3,7 @@
-
原料类型
+
物料类型
保存 @@ -17,15 +17,22 @@
- 原料类型: + 原料/包装物: +
+ 原料 + 包装物 +
+
+
+ 物料类型:
- 原料编码: + 物料编码:
- 原料Code: + 物料Code:
@@ -41,8 +48,10 @@ data() { return { submitdisabled: false, + radio:"1", formobj: { sid: "", + type:"", name: "", number: "", code: "" @@ -51,6 +60,12 @@ }, methods: { saveOrUpdate() { + + console.log("radio》》》》》》》",this.radio) + + this.formobj.type = this.radio + + if(this.formobj.sid){ req.updateData(this.formobj) .then(resp => { diff --git a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/rawMaterialType/oilTypeInfo.vue b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/materialType/oilTypeInfo.vue similarity index 100% rename from yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/rawMaterialType/oilTypeInfo.vue rename to yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/materialType/oilTypeInfo.vue diff --git a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/oilTank/oilTankAdd.vue b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/oilTank/oilTankAdd.vue index 15076bb4..4fc517ca 100644 --- a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/oilTank/oilTankAdd.vue +++ b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/oilTank/oilTankAdd.vue @@ -21,14 +21,14 @@
- 原油类型: - + 原油名称: +
- 原油编号: + 原油编码:
diff --git a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/inventory/oilTypeInBoundList/index.vue b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/inventory/oilTypeInBoundList/index.vue index 63ec3a97..83fe51c6 100644 --- a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/inventory/oilTypeInBoundList/index.vue +++ b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/inventory/oilTypeInBoundList/index.vue @@ -32,8 +32,9 @@ + + - diff --git a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/supervise/oilTypeInBound/index.vue b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/supervise/oilTypeInBound/index.vue index 94ac08da..67bda2d5 100644 --- a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/supervise/oilTypeInBound/index.vue +++ b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/supervise/oilTypeInBound/index.vue @@ -38,6 +38,18 @@
+
+ 原油名称: + + + + +
+
+ 原油编号: + + +
油罐编号: @@ -45,11 +57,6 @@
-
- 原油种类: - - -
收料净重: @@ -63,6 +70,12 @@ 备注:
+
+ 登记材料: + + +
@@ -72,38 +85,69 @@ @@ -165,6 +235,7 @@ margin-right: 60px; min-width: 70%; margin-top: 20px; + padding-bottom: 50px; .item { display: flex; @@ -221,4 +292,4 @@ } } - \ No newline at end of file + diff --git a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/supervise/recordOilTank/index.vue b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/supervise/recordOilTank/index.vue index 5ab8580e..52063fd9 100644 --- a/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/supervise/recordOilTank/index.vue +++ b/yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/supervise/recordOilTank/index.vue @@ -26,6 +26,12 @@ 油罐库存高度: +
+ 登记材料: + + +
@@ -36,12 +42,18 @@ @@ -114,6 +137,7 @@ margin-right: 60px; min-width: 70%; margin-top: 20px; + padding-bottom: 50px; .item { display: flex; diff --git a/yxt-supervise-dbcenter/docs/databases/table_create-data-init.sql b/yxt-supervise-dbcenter/docs/databases/table_create-data-init.sql new file mode 100644 index 00000000..4fdd92ad --- /dev/null +++ b/yxt-supervise-dbcenter/docs/databases/table_create-data-init.sql @@ -0,0 +1,12 @@ +-- 企业/集团信息 +INSERT INTO `enp_info` (`sid`, `name`, `code`) VALUES + ('1001', '中鸿记', '1001'); +-- 企业品牌信息 +INSERT INTO `enp_brand` (`sid`, `name`, `code`, `enpSid`, `enpCode`, `enpName`) VALUES + ('100101', '熟溢香', '100101', '1001', '1001', '中鸿记'), + ('100102', '馍馍卤', '100102', '1001', '1001', '中鸿记'); +-- 企业门店信息 +INSERT INTO `enp_store` (`sid`, `name`, `code`, `enpSid`, `enpCode`, `enpName`, `brandSid`, `brandCode`, `brandName`) VALUES + ('10010101', '熟溢香振头店', '10010101', '1001', '1001', '中鸿记','100101', '100101', '熟溢香'), + ('10010102', '馍馍卤振岗店', '10010102', '1001', '1001', '中鸿记','100102', '100102', '馍馍卤'), + ('10010103', '馍馍卤雅清街店', '10010103', '1001', '1001', '中鸿记','100102', '100102', '馍馍卤'); diff --git a/yxt-supervise-dbcenter/docs/databases/table_create.sql b/yxt-supervise-dbcenter/docs/databases/table_create.sql index 9f21bbd3..fe0affcd 100644 --- a/yxt-supervise-dbcenter/docs/databases/table_create.sql +++ b/yxt-supervise-dbcenter/docs/databases/table_create.sql @@ -19,6 +19,10 @@ CREATE TABLE `enp_info` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB COMMENT='企业/集团信息' ROW_FORMAT = Dynamic; +INSERT INTO `enp_info` (`sid`, `name`, `code`) VALUES + ('1001', '中鸿记', '1001'); + + DROP TABLE IF EXISTS `enp_brand`; CREATE TABLE `enp_brand` ( `id` int(0) NOT NULL AUTO_INCREMENT COMMENT 'id', @@ -41,6 +45,10 @@ CREATE TABLE `enp_brand` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB COMMENT='企业品牌信息' ROW_FORMAT = Dynamic; +INSERT INTO `enp_brand` (`sid`, `name`, `code`, `enpSid`, `enpCode`, `enpName`) VALUES + ('100101', '熟溢香', '100101', '1001', '1001', '中鸿记'), + ('100102', '馍馍卤', '100102', '1001', '1001', '中鸿记'); + DROP TABLE IF EXISTS `enp_store`; CREATE TABLE `enp_store` ( `id` int(0) NOT NULL AUTO_INCREMENT COMMENT 'id', @@ -66,6 +74,11 @@ CREATE TABLE `enp_store` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB COMMENT='企业门店信息' ROW_FORMAT = Dynamic; +INSERT INTO `enp_store` (`sid`, `name`, `code`, `enpSid`, `enpCode`, `enpName`, `brandSid`, `brandCode`, `brandName`) VALUES + ('10010101', '熟溢香振头店', '10010101', '1001', '1001', '中鸿记','100101', '100101', '熟溢香'), + ('10010102', '馍馍卤振岗店', '10010102', '1001', '1001', '中鸿记','100102', '100102', '馍馍卤'), + ('10010103', '馍馍卤雅清街店', '10010103', '1001', '1001', '中鸿记','100102', '100102', '馍馍卤'); + DROP TABLE IF EXISTS `dishes_info`; CREATE TABLE `dishes_info` ( `id` int(0) NOT NULL AUTO_INCREMENT COMMENT 'id', diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/CrawlTask.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/CrawlTask.java index c7e2bfad..3d98a7cb 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/CrawlTask.java +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/CrawlTask.java @@ -30,9 +30,10 @@ public class CrawlTask { @Scheduled(cron = "0 30 10 * * ?") public void pullZhjData() { String currDay = DateUtil.format(DateUtil.offsetDay(new Date(), -1), "yyyy-MM-dd"); + String purchaseDay = DateUtil.format(DateUtil.offsetDay(new Date(), -2), "yyyy-MM-dd"); ThreadUtil.execute(() -> crawlSalesAmountService.pullData(currDay)); ThreadUtil.execute(() -> crawlSalesDishesService.pullData(currDay)); - ThreadUtil.execute(() -> crawlPurchaseService.pullData(currDay)); + ThreadUtil.execute(() -> crawlPurchaseService.pullData(purchaseDay)); } } diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesAmount/CrawlSalesAmountMapper.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesAmount/CrawlSalesAmountMapper.java index 60f74c07..b6784240 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesAmount/CrawlSalesAmountMapper.java +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesAmount/CrawlSalesAmountMapper.java @@ -15,9 +15,7 @@ import org.apache.ibatis.annotations.Param; */ @Mapper public interface CrawlSalesAmountMapper extends BaseMapper { - CrawlSalesAmount select(); - - IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + IPage listPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); @Delete("delete from crawl_sales_amount where dataDate=#{dataDate} ") void deleteOfDay(@Param("dataDate") String currDay); diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesAmount/CrawlSalesAmountMapper.xml b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesAmount/CrawlSalesAmountMapper.xml index 59d3925a..189fc516 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesAmount/CrawlSalesAmountMapper.xml +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesAmount/CrawlSalesAmountMapper.xml @@ -1,17 +1,12 @@ - - - - - + SELECT s.enpName,b.name,a.storeName,a.dataDate,a.salesAmount + FROM crawl_sales_amount a + inner join enp_store s on s.name = a.storeName + inner join enp_brand b on s.brandName = b.name ${ew.sqlSegment} diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesAmount/CrawlSalesAmountService.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesAmount/CrawlSalesAmountService.java index cb70aa14..52803148 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesAmount/CrawlSalesAmountService.java +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesAmount/CrawlSalesAmountService.java @@ -1,19 +1,15 @@ package com.yxt.supervise.dbcenter.zhj.crawl.biz.crawlSalesAmount; import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.base.utils.PagerUtil; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; import com.yxt.supervise.dbcenter.zhj.crawl.ZhjSpider; import com.yxt.supervise.dbcenter.zhj.crawl.spider.RespSalesAmount; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -41,7 +37,7 @@ public class CrawlSalesAmountService extends ServiceImpl qw = new QueryWrapper<>(); if (query != null){ - if (StrUtil.isNotBlank(query.getStoreName())){ + if (query.getStoreName() != null && !query.getStoreName().equals("")){ qw.eq("a.storeName",query.getStoreName()); } if (query.getFromTime() != null && !query.getFromTime().equals("")){ @@ -54,39 +50,41 @@ public class CrawlSalesAmountService extends ServiceImpl crawlSalesAmountIPage = baseMapper.selectPage(page, qw); +// List records = crawlSalesAmountIPage.getRecords(); +// List voList = new ArrayList<>(); +// for (CrawlSalesAmount csa: records){ +// CrawlSalesAmountVo vo = new CrawlSalesAmountVo(); +// BeanUtil.copyProperties(csa,vo); +// vo.setEnpName("中鸿记"); +// String storeName = csa.getStoreName(); +// if("熟溢香振头店".equals(storeName)){ +// vo.setName("熟溢香"); +// }else{ +// vo.setName("馍馍卤"); +// } +// vo.setOils(csa.getSalesAmount()*50*0.01); +// vo.setRice(csa.getSalesAmount()*30*0.01); +// vo.setFace(csa.getSalesAmount()*20*0.01); +// vo.setTotalCount(vo.getOils()+vo.getRice()+vo.getFace()); +// voList.add(vo); +// } +// +// PagerVo pvo = new PagerVo<>(); +// PagerVo pv = PagerUtil.pageToVo(crawlSalesAmountIPage, pvo); +// pv.setRecords(voList); IPage page = PagerUtil.queryToPage(pq); - IPage crawlSalesAmountIPage = baseMapper.selectPage(page, qw); - List records = crawlSalesAmountIPage.getRecords(); - List voList = new ArrayList<>(); - for (CrawlSalesAmount csa: records){ - CrawlSalesAmountVo vo = new CrawlSalesAmountVo(); - BeanUtil.copyProperties(csa,vo); - vo.setEnpName("中鸿记"); - String storeName = csa.getStoreName(); - if("熟溢香振头店".equals(storeName)){ - vo.setName("熟溢香"); - }else{ - vo.setName("馍馍卤"); - } - vo.setOils(csa.getSalesAmount()*50*0.01); - vo.setRice(csa.getSalesAmount()*30*0.01); - vo.setFace(csa.getSalesAmount()*20*0.01); - vo.setTotalCount(vo.getOils()+vo.getRice()+vo.getFace()); - voList.add(vo); + IPage pagging = baseMapper.listPageVo(page, qw); + PagerVo pv = PagerUtil.pageToVo(pagging, null); + List records = pv.getRecords(); + for (CrawlSalesAmountVo record : records) { + record.setOils(record.getSalesAmount()*50*0.01); + record.setRice(record.getSalesAmount()*30*0.01); + record.setFace(record.getSalesAmount()*20*0.01); + record.setTotalCount(record.getOils()+record.getRice()+record.getFace()); } - - PagerVo pvo = new PagerVo<>(); - PagerVo pv = PagerUtil.pageToVo(crawlSalesAmountIPage, pvo); - pv.setRecords(voList); -// IPage pagging = baseMapper.selectPage();//.selectPageVo(page, qw); -// PagerVo pv = PagerUtil.pageToVo(pagging, null); -// List records = pv.getRecords(); -// for (CrawlSalesAmountVo record : records) { -// record.setOils(record.getSalesAmount()*50*0.01); -// record.setRice(record.getSalesAmount()*30*0.01); -// record.setFace(record.getSalesAmount()*20*0.01); -// record.setTotalCount(record.getOils()+record.getRice()+record.getFace()); -// } return pv; } diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesDishes/CrawlSalesDishesMapper.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesDishes/CrawlSalesDishesMapper.java index daaa386d..d06d3645 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesDishes/CrawlSalesDishesMapper.java +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesDishes/CrawlSalesDishesMapper.java @@ -16,6 +16,8 @@ public interface CrawlSalesDishesMapper extends BaseMapper { List selectSalesDishesList(CrawlSalesDishesDto dto); + List selectSalesDishesListList(CrawlSalesDishesDto dto); + @Delete("delete from crawl_sales_dishes where dataDate=#{dataDate} ") void deleteOfDay(@Param("dataDate") String currDay); } diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesDishes/CrawlSalesDishesMapper.xml b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesDishes/CrawlSalesDishesMapper.xml index 39032901..e96469f0 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesDishes/CrawlSalesDishesMapper.xml +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesDishes/CrawlSalesDishesMapper.xml @@ -8,4 +8,8 @@ where a.storeName = #{StoreName} and d.dataDate = #{dataDate} + + \ No newline at end of file diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesDishes/CrawlSalesDishesService.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesDishes/CrawlSalesDishesService.java index b0d3b26b..9422ecab 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesDishes/CrawlSalesDishesService.java +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlSalesDishes/CrawlSalesDishesService.java @@ -34,7 +34,7 @@ public class CrawlSalesDishesService extends ServiceImpl crawlSalesDishes = baseMapper.selectSalesDishesList(dto); + List crawlSalesDishes = baseMapper.selectSalesDishesListList(dto); if (crawlSalesDishes == null || crawlSalesDishes.size() == 0) { return rb.setMsg("此门店下没有销售数据"); } diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlpurchase/CrawlPurchaseMapper.xml b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlpurchase/CrawlPurchaseMapper.xml index d102d7b8..2c87a5f1 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlpurchase/CrawlPurchaseMapper.xml +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/crawlpurchase/CrawlPurchaseMapper.xml @@ -3,7 +3,7 @@ - select * from crawl_purchase where storeName = #{storeName} and dataDate = #{dataDate} diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/dishesInfo/DishesInfoService.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/dishesInfo/DishesInfoService.java index c38dff9e..606e1e84 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/dishesInfo/DishesInfoService.java +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/dishesInfo/DishesInfoService.java @@ -16,14 +16,11 @@ import java.util.List; @Service public class DishesInfoService extends MybatisBaseService { - @Autowired - private DishesInfoMapper dishesInfoMapper; - public ResultBean save(DishesInfoDto dto){ ResultBean rb = ResultBean.fireFail(); DishesInfo info = new DishesInfo(); BeanUtil.copyProperties(dto,info,"id","sid"); - int insert = dishesInfoMapper.insert(info); + int insert = baseMapper.insert(info); if (insert == 0){ return rb.setMsg("添加失败"); } @@ -35,7 +32,7 @@ public class DishesInfoService extends MybatisBaseService().eq("sid", sid)); + int delete = baseMapper.delete(new QueryWrapper().eq("sid", sid)); if (delete == 0){ return rb.setMsg("删除失败"); } @@ -53,7 +50,7 @@ public class DishesInfoService extends MybatisBaseService dishesInfos = dishesInfoMapper.selectDishesInfoList(); + List dishesInfos = baseMapper.selectDishesInfoList(); return rb.success().setData(dishesInfos); } } diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpBrand/EnpBrandMapper.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpBrand/EnpBrandMapper.java index 35c1f3b9..8dc2b3ed 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpBrand/EnpBrandMapper.java +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpBrand/EnpBrandMapper.java @@ -10,5 +10,5 @@ import org.apache.ibatis.annotations.Param; */ @Mapper public interface EnpBrandMapper extends BaseMapper { - void deleteEnpBrandBySid(@Param("sid") String sid); + EnpBrand selectEnpBrandBEnpySid(@Param("sid") String sid); } diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpBrand/EnpBrandMapper.xml b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpBrand/EnpBrandMapper.xml index e8f05409..a646fe6a 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpBrand/EnpBrandMapper.xml +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpBrand/EnpBrandMapper.xml @@ -1,7 +1,7 @@ - - delete from enp_brand where sid = #{sid} - + \ No newline at end of file diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpBrand/EnpBrandService.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpBrand/EnpBrandService.java index f6245844..a16ec196 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpBrand/EnpBrandService.java +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpBrand/EnpBrandService.java @@ -2,7 +2,10 @@ package com.yxt.supervise.dbcenter.zhj.crawl.biz.enpBrand; import cn.hutool.core.bean.BeanUtil; import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.StringUtils; import com.yxt.common.core.result.ResultBean; +import com.yxt.supervise.dbcenter.zhj.crawl.biz.enpStore.EnpStore; +import com.yxt.supervise.dbcenter.zhj.crawl.biz.enpStore.EnpStoreMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -14,13 +17,13 @@ import org.springframework.stereotype.Service; public class EnpBrandService extends MybatisBaseService { @Autowired - private EnpBrandMapper enpBrandMapper; + private EnpStoreMapper enpStoreMapper; public ResultBean save(EnpBrandDto dto){ ResultBean rb = ResultBean.fireFail(); EnpBrand enpBrand = new EnpBrand(); BeanUtil.copyProperties(dto,enpBrand); - int insert = enpBrandMapper.insert(enpBrand); + int insert = baseMapper.insert(enpBrand); if (insert == 0){ return rb.setMsg("添加失败"); } @@ -29,7 +32,7 @@ public class EnpBrandService extends MybatisBaseService + + + + \ No newline at end of file diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpInfo/EnpInfoRest.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpInfo/EnpInfoRest.java index dac70d01..5540c9c7 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpInfo/EnpInfoRest.java +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpInfo/EnpInfoRest.java @@ -4,6 +4,7 @@ import com.yxt.common.core.result.ResultBean; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -20,9 +21,21 @@ public class EnpInfoRest { @Autowired private EnpInfoService enpInfoService; - @ApiOperation("新增企业") + @ApiOperation("新增企业信息") @RequestMapping("/save") public ResultBean save(@RequestBody EnpInfoDto enpInfoDto){ return enpInfoService.save(enpInfoDto); } + + @ApiOperation("删除该企业信息") + @RequestMapping("/deleteEnpInfoBySid/{sid}") + public ResultBean deleteEnpInfoBySid(@PathVariable String sid){ + return enpInfoService.deleteEnpInfoBySid(sid); + } + + @ApiOperation("修改该企业信息") + @RequestMapping("/alterEnpInfo") + public ResultBean alterEnpInfo(@RequestBody EnpInfoDto dto){ + return enpInfoService.alterEnpInfo(dto); + } } diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpInfo/EnpInfoService.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpInfo/EnpInfoService.java index f38987f0..29237ea4 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpInfo/EnpInfoService.java +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpInfo/EnpInfoService.java @@ -1,9 +1,15 @@ package com.yxt.supervise.dbcenter.zhj.crawl.biz.enpInfo; +import cn.hutool.core.bean.BeanUtil; import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.StringUtils; import com.yxt.common.core.result.ResultBean; +import com.yxt.supervise.dbcenter.zhj.crawl.biz.enpBrand.EnpBrand; +import com.yxt.supervise.dbcenter.zhj.crawl.biz.enpBrand.EnpBrandMapper; +import com.yxt.supervise.dbcenter.zhj.crawl.biz.enpStore.EnpStore; +import com.yxt.supervise.dbcenter.zhj.crawl.biz.enpStore.EnpStoreMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.RequestBody; /** * @author shkstart @@ -12,7 +18,59 @@ import org.springframework.web.bind.annotation.RequestBody; @Service public class EnpInfoService extends MybatisBaseService{ - public ResultBean save(EnpInfoDto enpInfoDto){ - return null; + @Autowired + private EnpBrandMapper enpBrandMapper; + @Autowired + private EnpStoreMapper enpStoreMapper; + + public ResultBean save(EnpInfoDto dto){ + ResultBean rb = ResultBean.fireFail(); + EnpInfo enpInfo = new EnpInfo(); + BeanUtil.copyProperties(dto,enpInfo); + int insert = baseMapper.insert(enpInfo); + if (insert == 0){ + return rb.setMsg("新增失败"); + } + return rb.success().setMsg("新增成功"); + } + + public ResultBean deleteEnpInfoBySid(String sid){ + ResultBean rb = ResultBean.fireFail(); + int i = deleteBySid(sid); + if (i == 0){ + return rb.setMsg("删除失败"); + } + return rb.success().setMsg("删除成功"); + } + + public ResultBean alterEnpInfo(EnpInfoDto dto){ + ResultBean rb = ResultBean.fireFail(); + EnpInfo enpInfo = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto,enpInfo,"id","sid"); + int i = baseMapper.updateById(enpInfo); + EnpBrand enpBrand = enpBrandMapper.selectEnpBrandBEnpySid(dto.getSid()); + EnpStore enpStore = enpStoreMapper.selectEnpStoreByEnpSid(dto.getSid()); + if (enpBrand != null || enpStore != null){ + if (StringUtils.isNotNull(dto.getCode())){ + enpBrand.setEnpCode(dto.getCode()); + enpStore.setEnpCode(dto.getCode()); + } + if (StringUtils.isNotNull(dto.getName())){ + enpBrand.setEnpName(dto.getName()); + enpStore.setEnpName(dto.getName()); + } + if (enpBrand != null){ + //修改企业品牌中所属企业的信息 + enpBrandMapper.updateById(enpBrand); + } + if (enpStore != null){ + //修改企业门店中所属企业的信息 + enpStoreMapper.updateById(enpStore); + } + } + if (i == 0){ + return rb.setMsg("修改失败"); + } + return rb.success().setMsg("修改成功"); } } diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpStore/EnpStoreDto.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpStore/EnpStoreDto.java new file mode 100644 index 00000000..23e9b254 --- /dev/null +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpStore/EnpStoreDto.java @@ -0,0 +1,112 @@ +package com.yxt.supervise.dbcenter.zhj.crawl.biz.enpStore; + +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @author shkstart + * @create 2023-05-11-11:03 + */ +@ApiModel("企业门店信息 传输对象") +public class EnpStoreDto implements Dto { + private String id; + private String sid; + + @ApiModelProperty("门店编码") + private String code; + @ApiModelProperty("门店名称") + private String name; + @ApiModelProperty("所属企业Sid") + private String enpSid; + @ApiModelProperty("所属企业编码") + private String enpCode; + @ApiModelProperty("所属企业名称") + private String enpName; + @ApiModelProperty("所属品牌Sid") + private String brandSid; + @ApiModelProperty("所属品牌编码") + private String brandCode; + @ApiModelProperty("所属品牌名称") + private String brandName; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getSid() { + return sid; + } + + public void setSid(String sid) { + this.sid = sid; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getEnpSid() { + return enpSid; + } + + public void setEnpSid(String enpSid) { + this.enpSid = enpSid; + } + + public String getEnpCode() { + return enpCode; + } + + public void setEnpCode(String enpCode) { + this.enpCode = enpCode; + } + + public String getEnpName() { + return enpName; + } + + public void setEnpName(String enpName) { + this.enpName = enpName; + } + + public String getBrandSid() { + return brandSid; + } + + public void setBrandSid(String brandSid) { + this.brandSid = brandSid; + } + + public String getBrandCode() { + return brandCode; + } + + public void setBrandCode(String brandCode) { + this.brandCode = brandCode; + } + + public String getBrandName() { + return brandName; + } + + public void setBrandName(String brandName) { + this.brandName = brandName; + } +} diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpStore/EnpStoreMapper.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpStore/EnpStoreMapper.java new file mode 100644 index 00000000..2f8d0394 --- /dev/null +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpStore/EnpStoreMapper.java @@ -0,0 +1,16 @@ +package com.yxt.supervise.dbcenter.zhj.crawl.biz.enpStore; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @author shkstart + * @create 2023-05-11-11:11 + */ +@Mapper +public interface EnpStoreMapper extends BaseMapper { + EnpStore selectEnpStoreByEnpSid(@Param("sid") String sid); + + EnpStore selectEnpStoreByBrandSid(@Param("sid") String sid); +} diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpStore/EnpStoreMapper.xml b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpStore/EnpStoreMapper.xml new file mode 100644 index 00000000..33471513 --- /dev/null +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpStore/EnpStoreMapper.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpStore/EnpStoreRest.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpStore/EnpStoreRest.java new file mode 100644 index 00000000..44c8c179 --- /dev/null +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpStore/EnpStoreRest.java @@ -0,0 +1,41 @@ +package com.yxt.supervise.dbcenter.zhj.crawl.biz.enpStore; + +import com.yxt.common.core.result.ResultBean; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author shkstart + * @create 2023-05-11-11:07 + */ +@Api("企业门店信息") +@RestController +@RequestMapping("dbCenter/enpStore") +public class EnpStoreRest { + + @Autowired + private EnpStoreService enpStoreService; + + @ApiOperation("新增企业门店信息") + @RequestMapping("/save") + public ResultBean save(@RequestBody EnpStoreDto dto){ + return enpStoreService.save(dto); + } + + @ApiOperation("删除企业门店信息") + @RequestMapping("/deleteEnpStore/{sid}") + public ResultBean deleteEnpStore(@PathVariable String sid){ + return enpStoreService.deleteEnpStore(sid); + } + + @ApiOperation("修改企业门店信息") + @RequestMapping("/alterEnpStore") + public ResultBean alterEnpStore(@RequestBody EnpStoreDto dto){ + return enpStoreService.alterEnpStore(dto); + } +} diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpStore/EnpStoreService.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpStore/EnpStoreService.java new file mode 100644 index 00000000..e3eac574 --- /dev/null +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpStore/EnpStoreService.java @@ -0,0 +1,42 @@ +package com.yxt.supervise.dbcenter.zhj.crawl.biz.enpStore; + +import cn.hutool.core.bean.BeanUtil; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.core.result.ResultBean; +import org.springframework.stereotype.Service; + +/** + * @author shkstart + * @create 2023-05-11-11:11 + */ +@Service +public class EnpStoreService extends MybatisBaseService { + + public ResultBean save(EnpStoreDto dto){ + ResultBean rb = ResultBean.fireFail(); + EnpStore store = new EnpStore(); + BeanUtil.copyProperties(dto,store); + int insert = baseMapper.insert(store); + if (insert == 0){ + return rb.setMsg("新增失败"); + } + return rb.success().setMsg("新增成功"); + } + + public ResultBean deleteEnpStore(String sid){ + ResultBean rb = ResultBean.fireFail(); + int i = deleteBySid(sid); + return rb.success().setMsg("删除成功"); + } + + public ResultBean alterEnpStore(EnpStoreDto dto){ + ResultBean rb = ResultBean.fireFail(); + EnpStore enpStore = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto,enpStore,"id","sid"); + int i = baseMapper.updateById(enpStore); + if (i == 0){ + return rb.setMsg("修改失败"); + } + return rb.success().setMsg("修改成功"); + } +} diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/materialInfo/MaterialInfo.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/materialInfo/MaterialInfo.java index b3db38f2..3bd2f317 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/materialInfo/MaterialInfo.java +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/materialInfo/MaterialInfo.java @@ -18,4 +18,36 @@ public class MaterialInfo extends BaseEntity { private String unit; @ApiModelProperty("含税单位") private String taxPrice; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getTaxPrice() { + return taxPrice; + } + + public void setTaxPrice(String taxPrice) { + this.taxPrice = taxPrice; + } } diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/materialInfo/MaterialInfoDto.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/materialInfo/MaterialInfoDto.java new file mode 100644 index 00000000..9bc3037a --- /dev/null +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/materialInfo/MaterialInfoDto.java @@ -0,0 +1,72 @@ +package com.yxt.supervise.dbcenter.zhj.crawl.biz.materialInfo; + +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @author shkstart + * @create 2023-05-11-11:26 + */ +@ApiModel("物料信息 传输对象") +public class MaterialInfoDto implements Dto { + private String id; + private String sid; + + @ApiModelProperty("物料编码") + private String code; + @ApiModelProperty("物料名称") + private String name; + @ApiModelProperty("规格单位") + private String unit; + @ApiModelProperty("含税单位") + private String taxPrice; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getSid() { + return sid; + } + + public void setSid(String sid) { + this.sid = sid; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getTaxPrice() { + return taxPrice; + } + + public void setTaxPrice(String taxPrice) { + this.taxPrice = taxPrice; + } +} diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/materialInfo/MaterialInfoMapper.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/materialInfo/MaterialInfoMapper.java new file mode 100644 index 00000000..4f713ac0 --- /dev/null +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/materialInfo/MaterialInfoMapper.java @@ -0,0 +1,12 @@ +package com.yxt.supervise.dbcenter.zhj.crawl.biz.materialInfo; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author shkstart + * @create 2023-05-11-11:35 + */ +@Mapper +public interface MaterialInfoMapper extends BaseMapper { +} diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/materialInfo/MaterialInfoRest.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/materialInfo/MaterialInfoRest.java new file mode 100644 index 00000000..810adc62 --- /dev/null +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/materialInfo/MaterialInfoRest.java @@ -0,0 +1,41 @@ +package com.yxt.supervise.dbcenter.zhj.crawl.biz.materialInfo; + +import com.yxt.common.core.result.ResultBean; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author shkstart + * @create 2023-05-11-11:28 + */ +@Api("物料信息") +@RestController +@RequestMapping("dbCenter/materialInfo") +public class MaterialInfoRest { + + @Autowired + private MaterialInfoService materialInfoService; + + @ApiOperation("新增物料信息") + @RequestMapping("/save") + public ResultBean save(@RequestBody MaterialInfoDto dto){ + return materialInfoService.save(dto); + } + + @ApiOperation("删除物料信息") + @RequestMapping("/deleteMaterialInfo/{sid}") + public ResultBean deleteMaterialInfo(@PathVariable String sid){ + return materialInfoService.deleteMaterialInfo(sid); + } + + @ApiOperation("修改物料信息") + @RequestMapping("/alterMaterialInfo") + public ResultBean alterMaterialInfo(@RequestBody MaterialInfoDto dto){ + return materialInfoService.alterMaterialInfo(dto); + } +} diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/materialInfo/MaterialInfoService.java b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/materialInfo/MaterialInfoService.java new file mode 100644 index 00000000..40807263 --- /dev/null +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/materialInfo/MaterialInfoService.java @@ -0,0 +1,42 @@ +package com.yxt.supervise.dbcenter.zhj.crawl.biz.materialInfo; + +import cn.hutool.core.bean.BeanUtil; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.core.result.ResultBean; +import org.springframework.stereotype.Service; + +/** + * @author shkstart + * @create 2023-05-11-11:34 + */ +@Service +public class MaterialInfoService extends MybatisBaseService { + + public ResultBean save(MaterialInfoDto dto){ + ResultBean rb = ResultBean.fireFail(); + MaterialInfo info = new MaterialInfo(); + BeanUtil.copyProperties(dto,info); + int insert = baseMapper.insert(info); + if (insert == 0){ + return rb.setMsg("新增失败"); + } + return rb.success().setMsg("新增成功"); + } + + public ResultBean deleteMaterialInfo(String sid){ + ResultBean rb = ResultBean.fireFail(); + int i = deleteBySid(sid); + return rb.success().setMsg("删除成功"); + } + + public ResultBean alterMaterialInfo(MaterialInfoDto dto){ + ResultBean rb = ResultBean.fireFail(); + MaterialInfo materialInfo = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto,materialInfo,"id","sid"); + int i = baseMapper.updateById(materialInfo); + if (i == 0){ + return rb.setMsg("修改失败"); + } + return rb.success().setMsg("修改成功"); + } +} diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-ui/src/api/Zhj/inquireStatistics/index.js b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-ui/src/api/Zhj/inquireStatistics/index.js index 84ea1bc7..03f5a6bd 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-ui/src/api/Zhj/inquireStatistics/index.js +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-ui/src/api/Zhj/inquireStatistics/index.js @@ -1,7 +1,6 @@ import request from '@/utils/request' -// 接口文档名称:潜在客户信息 -// Pc端客户基础信息条件分页查询数据的列表 +// 查询 export function listPage(data) { return request({ url: '/dbCenter/crawlAmount/listPage', @@ -13,16 +12,27 @@ export function listPage(data) { }) } -// 客户查询 -export function listPageByOrgPathSid(data) { - return request({ - url: '/crm/v1/crmcustomertemp/listPageByOrgPathSid', - method: 'post', - data: data, - headers: { - 'Content-Type': 'application/json' - } - }) + // 查询采购数据 +export function selectPurchaseList(data) { +return request({ + url: '/dbCenter/crawlPurchase/selectPurchaseList', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } +}) +} + // 查询销售数据 +export function selectSalesDishes(data) { +return request({ + url: '/dbCenter/crawlDishes/selectSalesDishes', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } +}) } // 添加 已改 diff --git a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-ui/src/layout/components/Sidebar/index.vue b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-ui/src/layout/components/Sidebar/index.vue index fcab8400..29645046 100644 --- a/yxt-supervise-dbcenter/yxt-supervise-dbcenter-ui/src/layout/components/Sidebar/index.vue +++ b/yxt-supervise-dbcenter/yxt-supervise-dbcenter-ui/src/layout/components/Sidebar/index.vue @@ -3,7 +3,7 @@ - - +
-
- +
+ @@ -78,13 +74,13 @@ - + - + - + - + -