From a2d473190ff081e6de4b1a334f1c80e58e12b727 Mon Sep 17 00:00:00 2001 From: shenyuan Date: Tue, 6 Jun 2023 15:17:42 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=95=86=E5=9F=8E=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/shopping/shopHome.vue | 75 +++++++++++-------- 1 file changed, 42 insertions(+), 33 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/shopping/shopHome.vue b/ant-design-vue-jeecg/src/views/shopping/shopHome.vue index dddc9e10..f0578cf2 100644 --- a/ant-design-vue-jeecg/src/views/shopping/shopHome.vue +++ b/ant-design-vue-jeecg/src/views/shopping/shopHome.vue @@ -42,31 +42,32 @@ -
-
-
-

最新定制

-
-

Latest customization

-
-
-
- -

- {{ item.title1 }}|{{ item.title2 }} -

-

- 价格:¥{{ item.price }}元 -

-
-
-
- 了解更多 - -
-
-
+ + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -161,7 +162,7 @@ @click="tjspxq(item.id,item.title2)" > -

+

{{ item.title1 }}|{{ item.title2 }}

@@ -189,7 +190,7 @@ @click="tjspxq(item.id,item.title2)" > -

+

{{ item.title1 }}|{{ item.title2 }}

@@ -948,23 +949,31 @@ min-width: 270px; flex-direction: column; align-items: center; - padding-bottom: 30px; + padding-bottom: 10px; + padding-top: 10px; margin-bottom: 30px; margin-right: 11px; } .section5 .tabs .jz .item img { - width: 80%; + width: 90%; + height: 309px; + object-fit: cover; } .section5 .tabs .jz .item p { width: 100%; box-sizing: border-box; text-overflow: ellipsis; - padding-left: 28px; - padding-right: 28px; + padding: 15px; overflow: hidden; text-align: left; white-space: nowrap; } + .section5 .tabs .jz .item p.title_6{ + border-bottom: 1px dashed rgba(116,105,87,0.3) ; + color: #333; + font-size: 20px; + padding: 20px; + } .section5 .tabs .jz .item p .line { margin-left: 8px; margin-right: 8px; @@ -973,8 +982,8 @@ width: 100%; padding-left: 28px; box-sizing: border-box; - margin-top: 30px; - margin-bottom: 20px; + /*margin-top: 30px;*/ + /*margin-bottom: 20px;*/ } .section5 .tabs .jz .item div .el-tag { margin-right: 10px; From e816ee151cb8c141b25811daa3f9d8c5e3cca6e4 Mon Sep 17 00:00:00 2001 From: shenyuan Date: Tue, 6 Jun 2023 15:28:49 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=9C=8D=E8=A3=85=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/shopping/pages/clothType.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/shopping/pages/clothType.vue b/ant-design-vue-jeecg/src/views/shopping/pages/clothType.vue index 5316ae87..bce4c77a 100644 --- a/ant-design-vue-jeecg/src/views/shopping/pages/clothType.vue +++ b/ant-design-vue-jeecg/src/views/shopping/pages/clothType.vue @@ -459,8 +459,11 @@ .imgDiv { position: relative; img { - width: 308px; - height: 462px; + /*width: 308px;*/ + /*height: 462px;*/ + width: 287px; + height: 450px; + object-fit: cover; } &:hover .button { opacity: 1; From 51ed3a5dbf647a5150a16229754601c67413dbf5 Mon Sep 17 00:00:00 2001 From: Gitea Date: Tue, 6 Jun 2023 17:25:05 +0800 Subject: [PATCH 3/6] bug --- .../productrecord/ProductRecordList1.vue | 40 ++++- .../views/sensorrecord/SensorRecordList1.vue | 21 ++- .../src/views/team/modules/StationModal1.vue | 163 ++++++++++++++++++ .../controller/WorkOrderController.java | 30 +++- 4 files changed, 244 insertions(+), 10 deletions(-) create mode 100644 ant-design-vue-jeecg/src/views/team/modules/StationModal1.vue diff --git a/ant-design-vue-jeecg/src/views/productrecord/ProductRecordList1.vue b/ant-design-vue-jeecg/src/views/productrecord/ProductRecordList1.vue index 06d5d1af..70e08791 100644 --- a/ant-design-vue-jeecg/src/views/productrecord/ProductRecordList1.vue +++ b/ant-design-vue-jeecg/src/views/productrecord/ProductRecordList1.vue @@ -93,6 +93,12 @@ 下载 + + 编辑 @@ -122,6 +128,8 @@ + + @@ -133,13 +141,18 @@ import ProductRecordModal from './modules/ProductRecordModal' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import SensorRecordList1 from '../sensorrecord/SensorRecordList1' + import {deleteAction, getAction} from "@api/manage"; + import StationModal1 from '../team/modules/StationModal1' + import WorkOrderModal from '../workorder/modules/WorkOrderModal' export default { name: 'ProductRecordList', mixins:[JeecgListMixin, mixinDevice], components: { SensorRecordList1, - ProductRecordModal + ProductRecordModal, + StationModal1, + WorkOrderModal }, data () { return { @@ -159,12 +172,14 @@ { title:'工位', align:"center", - dataIndex: 'stationId_dictText' + dataIndex: 'stationId_dictText', + scopedSlots: {customRender: 'gw'} }, { title:'工单编号', align:"center", - dataIndex: 'orderCode' + dataIndex: 'orderCode', + scopedSlots: {customRender: 'gd'} }, { title:'生产开始时间', @@ -216,6 +231,25 @@ }, }, methods: { + gw(stationId){ + getAction("/team/station/queryById", {id: stationId}).then((res) => { + if (res.success) { + this.$refs.modalFormgw.edit(res.result); + this.$refs.modalFormgw.title="详情"; + } else { + } + }) + }, + gd(orderCode){ + getAction("/workOrder/workOrder/queryByOrderCode", {orderCode: orderCode}).then((res) => { + if (res.success) { + this.$refs.modalFormgd.edit(res.result); + this.$refs.modalFormgd.title="详情"; + this.$refs.modalFormgd.disableSubmit = true; + } else { + } + }) + }, initDictConfig(){ }, getSuperFieldList(){ diff --git a/ant-design-vue-jeecg/src/views/sensorrecord/SensorRecordList1.vue b/ant-design-vue-jeecg/src/views/sensorrecord/SensorRecordList1.vue index a110ab83..317e646b 100644 --- a/ant-design-vue-jeecg/src/views/sensorrecord/SensorRecordList1.vue +++ b/ant-design-vue-jeecg/src/views/sensorrecord/SensorRecordList1.vue @@ -66,6 +66,9 @@ 下载 + 编辑 @@ -90,6 +93,7 @@
+ @@ -100,12 +104,15 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' import SensorRecordModal from './modules/SensorRecordModal' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' + import StationModal1 from '../team/modules/StationModal1' + import {deleteAction, getAction} from "@api/manage"; export default { name: 'SensorRecordList1', mixins:[JeecgListMixin, mixinDevice], components: { - SensorRecordModal + SensorRecordModal, + StationModal1 }, data () { return { @@ -135,7 +142,8 @@ { title:'工位', align:"center", - dataIndex: 'stationId_dictText' + dataIndex: 'stationId_dictText', + scopedSlots: {customRender: 'gw'} }, { title:'进出标记', @@ -182,6 +190,15 @@ }, }, methods: { + gw(stationId){ + getAction("/team/station/queryById", {id: stationId}).then((res) => { + if (res.success) { + this.$refs.modalFormgw.edit(res.result); + this.$refs.modalFormgw.title="详情"; + } else { + } + }) + }, initDictConfig(){ }, getSuperFieldList(){ diff --git a/ant-design-vue-jeecg/src/views/team/modules/StationModal1.vue b/ant-design-vue-jeecg/src/views/team/modules/StationModal1.vue new file mode 100644 index 00000000..d75be23d --- /dev/null +++ b/ant-design-vue-jeecg/src/views/team/modules/StationModal1.vue @@ -0,0 +1,163 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/controller/WorkOrderController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/controller/WorkOrderController.java index 49a12936..5a01ef36 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/controller/WorkOrderController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/controller/WorkOrderController.java @@ -112,7 +112,7 @@ public class WorkOrderController extends JeecgController pageList = workOrderService.page(page, queryWrapper); return Result.OK(pageList); } - + /** * 添加 * @@ -126,7 +126,7 @@ public class WorkOrderController extends JeecgController queryByOrderCode(@RequestParam(name="orderCode",required=true) String orderCode,HttpServletRequest req) { + WorkOrder workOrder = new WorkOrder(); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(workOrder, req.getParameterMap()); + queryWrapper.eq("product_code",orderCode); + workOrder = workOrderService.list(queryWrapper).get(0); + if(workOrder==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(workOrder); + } + /** * 导出excel * From 8513246a11bfdff97ef85a01d1a50d9a6c943a9a Mon Sep 17 00:00:00 2001 From: shenyuan Date: Wed, 7 Jun 2023 09:03:21 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=9C=8D=E8=A3=85=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/shopping/assets/common.css | 5 +++- .../src/views/shopping/pages/clothType.vue | 25 +++++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/shopping/assets/common.css b/ant-design-vue-jeecg/src/views/shopping/assets/common.css index f4463678..d121717c 100644 --- a/ant-design-vue-jeecg/src/views/shopping/assets/common.css +++ b/ant-design-vue-jeecg/src/views/shopping/assets/common.css @@ -99,4 +99,7 @@ a { .c_31 { color: #313131; } -.textfield {overflow: hidden;text-overflow: ellipsis;white-space: nowrap;} \ No newline at end of file +.textfield {overflow: hidden;text-overflow: ellipsis;white-space: nowrap;} +*{ + font-family: PingFang SC-Semibold, PingFang SC; +} \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/shopping/pages/clothType.vue b/ant-design-vue-jeecg/src/views/shopping/pages/clothType.vue index bce4c77a..f3615240 100644 --- a/ant-design-vue-jeecg/src/views/shopping/pages/clothType.vue +++ b/ant-design-vue-jeecg/src/views/shopping/pages/clothType.vue @@ -59,10 +59,10 @@

- ¥{{ item.currentPrice }} + ¥{{ item.currentPrice }} ¥{{ item.historicalPrice }}

-

{{ item.title }}

+

{{ item.title }}

热度{{ item.heat }}

@@ -452,17 +452,20 @@ flex-wrap: wrap; align-items: center; .item { - width: 308px; + width: 288px; height: 562px; - margin-bottom: 30px; + padding: 10px; + margin-bottom: 0px; margin-right: 10px; + /*border: 0.5px solid #ccc;*/ + /*background-color: rgba(246, 246, 246, 1);*/ .imgDiv { position: relative; img { /*width: 308px;*/ /*height: 462px;*/ - width: 287px; - height: 450px; + width: 268px; + height: 380px; object-fit: cover; } &:hover .button { @@ -487,17 +490,23 @@ width: 100%; height: 100px; .price { + margin-top: 16px; align-items: center; + margin-bottom: 8px; padding-left: 6px; - .f_16 { + .f_18 { margin-right: 10px; } .f_12 { text-decoration: line-through; } } - & > .f_12 { + & > .f_16 { font-weight: 600; + height: 46px; + margin-bottom: 10px; + /*overflow: hidden;text-overflow: ellipsis;white-space: nowrap;*/ + overflow: hidden;display: -webkit-box;text-overflow: ellipsis;-webkit-line-clamp:2;-webkit-box-orient: vertical;white-space:normal; } } } From 8117e4abf255913b7dda31410664e3076b9f452f Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Wed, 7 Jun 2023 09:17:00 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E7=BA=BF=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E7=8A=B6=E6=80=81=20=E6=95=B0=E6=8D=AE=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=206.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/config/shiro/ShiroConfig.java | 3 + .../ProductionLargeScreenController.java | 21 +- .../service/ProductionLargeService.java | 2 +- .../impl/ProductionLargeServiceImpl.java | 223 ++++++++++-------- .../largeScreen/vo/ProductRecordVo.java | 9 +- .../controller/ZySpeechMessageController.java | 2 +- .../entity/vo/ZyPlanProcessVo.java | 14 ++ 7 files changed, 166 insertions(+), 108 deletions(-) create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ZyPlanProcessVo.java diff --git a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java index 0fdc2539..58ea92f9 100644 --- a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java +++ b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java @@ -128,7 +128,10 @@ public class ShiroConfig { filterChainDefinitionMap.put("/zyShopOrder/shopOrder/**","anon"); //大屏数据 filterChainDefinitionMap.put("/largeScreen/**","anon"); + + //生产大屏 filterChainDefinitionMap.put("/productionLargeScreen/**","anon"); + filterChainDefinitionMap.put("/org.jeecg.modules.message/zySpeechMessage/**","anon"); //人员管理 filterChainDefinitionMap.put("/zyPerson/**","anon"); diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/controller/ProductionLargeScreenController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/controller/ProductionLargeScreenController.java index 1cd28b6b..3b9d3ba3 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/controller/ProductionLargeScreenController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/controller/ProductionLargeScreenController.java @@ -26,18 +26,25 @@ public class ProductionLargeScreenController { * * @return */ - @ApiOperation(value = "获取生产设备大屏数据", notes = "获取生产设备大屏数据") - @GetMapping("/getData") - public Result getData() { - Map data = productionLargeService.getData(); - return Result.OK(data); - } +// @ApiOperation(value = "获取生产设备大屏数据", notes = "获取生产设备大屏数据") +// @GetMapping("/getData") +// public Result getData() { +// Map data = productionLargeService.getData(); +// return Result.OK(data); +// } - @ApiOperation(value = "获取生产设备大屏数据", notes = "获取生产设备大屏数据") + @ApiOperation(value = "生产大屏-生产线实时状态", notes = "生产线实时状态") @GetMapping("/shengchanxian_data") public Result shengchanxian_data() { Map data = productionLargeService.shengchanxian_data(); return Result.OK(data); } + @ApiOperation(value = "生产大屏-设备信息&吊挂&裁床", notes = "生产大屏-设备信息&吊挂&裁床") + @GetMapping("/shebeixinxi_data") + public Result shebeixinxi_data() { + Map data = productionLargeService.shebeixinxi_data(); + return Result.OK(data); + } + } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/ProductionLargeService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/ProductionLargeService.java index cc38e88c..0c85ddfa 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/ProductionLargeService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/ProductionLargeService.java @@ -4,7 +4,7 @@ import java.util.Map; public interface ProductionLargeService { - Map getData(); + Map shebeixinxi_data(); Map shengchanxian_data(); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/impl/ProductionLargeServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/impl/ProductionLargeServiceImpl.java index 6e814ac7..f20c0055 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/impl/ProductionLargeServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/impl/ProductionLargeServiceImpl.java @@ -1,31 +1,41 @@ package org.jeecg.modules.largeScreen.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import org.jeecg.common.exception.JeecgBootException; -import org.jeecg.modules.demo.productrecord.entity.ProductRecord; -import org.jeecg.modules.demo.productrecord.service.IProductRecordService; -import org.jeecg.modules.hanger.service.IHangRecordService; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.models.auth.In; +import org.jeecg.modules.demo.base.entity.ZyProcess; +import org.jeecg.modules.demo.base.service.IZyProcessService; +import org.jeecg.modules.device.entity.ZyDevice; +import org.jeecg.modules.device.service.IZyDeviceService; import org.jeecg.modules.largeScreen.service.ProductionLargeService; import org.jeecg.modules.largeScreen.vo.ProductRecordVo; import org.jeecg.modules.productplan.entity.ZyPlanProcess; import org.jeecg.modules.productplan.entity.ZyProductPlan; +import org.jeecg.modules.productplan.entity.vo.ZyPlanProcessVo; import org.jeecg.modules.productplan.service.IZyPlanProcessService; import org.jeecg.modules.productplan.service.IZyProductPlanService; import org.jeecg.modules.system.entity.SysDepart; import org.jeecg.modules.system.service.ISysDepartService; +import org.jeecg.modules.team.entity.Groupx; import org.jeecg.modules.team.entity.Station; +import org.jeecg.modules.team.service.IGroupxService; import org.jeecg.modules.team.service.IStationService; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.ObjectUtils; +import java.math.RoundingMode; +import java.text.DecimalFormat; +import java.time.LocalDate; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; @Service public class ProductionLargeServiceImpl implements ProductionLargeService { @Autowired - private IHangRecordService iHangRecordService; + private IZyProcessService iZyProcessService; @Autowired private IZyProductPlanService iZyProductPlanService; @@ -34,94 +44,117 @@ public class ProductionLargeServiceImpl implements ProductionLargeService { private IZyPlanProcessService iZyPlanProcessService; @Autowired - private IProductRecordService iProductRecordService; + private IGroupxService iGroupxService; @Autowired private IStationService iStationService; + @Autowired + private IZyDeviceService iZyDeviceService; @Autowired private ISysDepartService iSysDepartService; + // D00010:智能定制生产吊挂系统 + private static final String DIAOGUA = "D00010"; + + // D00002:智能定制裁床 + private static final String CAICHUANG = "D00002"; + + + /** + * 获取百分率 含% + * + * @param number + * @param denominator + * @return eg:33.33% + */ + public static String getRatioStr(double number, double denominator) { + String ratio = "0.0%"; + if (denominator != 0) { + DecimalFormat decimalFormat = new DecimalFormat("#0.0%"); + decimalFormat.setRoundingMode(RoundingMode.HALF_UP); + ratio = decimalFormat.format(number / denominator); + } + return ratio; + } + + public static void main(String[] args) { + String ratioStr = getRatioStr(78, 100); + System.out.println("ratioStr = " + ratioStr); + } + + /** + * 1,统计当天时间内生产工序 zy_plan_process + * 2,根据工序确定该工序所属工位 + * 3,根据工位确定所需设备(各类设备、吊挂、裁床)信息 + * + * @return + */ @Override - public Map getData() { + public Map shebeixinxi_data() { - Map resultMap = new HashMap<>(); - /*//1,吊挂 - // 分组统计,获取最新时间5条吊挂运行记录 - List recordList = iHangRecordService.list(new LambdaQueryWrapper().groupBy(HangRecord::getHangCode)); - Map diaoguaData = new HashMap<>(); - if (!ObjectUtils.isEmpty(recordList)) { - recordList.stream().forEach(e -> { - List records = iHangRecordService.list(new LambdaQueryWrapper() - .eq(HangRecord::getHangCode, e.getHangCode()) - .orderByDesc(HangRecord::getCreateTime) - .last("limit 5") - ); - diaoguaData.put(e.getHangCode(), records); - }); + Map resultMap = new HashMap<>(); +// List productPlanList = iZyProductPlanService.list(new QueryWrapper().eq("DATE_FORMAT (create_time,'%Y-%m-%d ')", LocalDate.now())); + List productPlanList = iZyProductPlanService.list(new QueryWrapper().eq("DATE_FORMAT (create_time,'%Y-%m-%d ')", "2023-06-03")); + if (!ObjectUtils.isEmpty(productPlanList)) { + Map diaoguaData = new HashMap<>(); + Map caichuangData = new HashMap<>(); + //1,吊挂 + ZyDevice diaogua = iZyDeviceService.getOne(new LambdaQueryWrapper().eq(ZyDevice::getTypeCode, DIAOGUA).last("limit 1")); + //当天生产计划列表 + diaoguaData.put("productPlanList", productPlanList); + //吊挂编码 + diaoguaData.put("code", diaogua.getCode()); + //负载 + String ratioStr = getRatioStr(productPlanList.size(), diaogua.getVal()); + diaoguaData.put("ratio", ratioStr); + resultMap.put("diaogua_", diaoguaData); + + //2,裁床 + ZyDevice caichuang = iZyDeviceService.getOne(new LambdaQueryWrapper().eq(ZyDevice::getTypeCode, CAICHUANG).last("limit 1")); + //当天生产计划列表 + caichuangData.put("productPlanList", productPlanList); + //吊挂编码 + caichuangData.put("code", caichuang.getCode()); + //负载 + caichuangData.put("ratio", getRatioStr(productPlanList.size(), caichuang.getVal())); + resultMap.put("caichuang_", caichuangData); } - resultMap.put("diaogua_data", diaoguaData);*/ - - -// //2,生产线实时状态 -// List stationGroup = iStationService.list(new LambdaQueryWrapper().groupBy(Station::getDepartId)); -// Map shengchanxianMap = new LinkedHashMap<>(); -// if (!ObjectUtils.isEmpty(stationGroup)) { -// stationGroup.stream().forEach(station -> { -// Map departMap = new LinkedHashMap<>(); -// //每个车间的工位 -// List stationList = iStationService.list(new LambdaQueryWrapper() -// .eq(Station::getDepartId, station.getDepartId()) -// .orderByAsc(Station::getStationNum) -// ); -// /** -// * 取每个工位的,生产记录状态0(生产中)的最新一条数据 -// */ -// List productRecordVos = new LinkedList<>(); -// Optional.ofNullable(stationList).orElse(new LinkedList<>()).forEach(obj -> { -// ProductRecord productRecord = iProductRecordService.getOne(new LambdaQueryWrapper() -// .eq(ProductRecord::getStationId, obj.getId()) -// .eq(ProductRecord::getStatus, "0") -// .orderByDesc(ProductRecord::getCreateTime) -// .last("limit 1") -// ); -// if (!ObjectUtils.isEmpty(productRecord)) { -// ZyProductPlan productPlan = iZyProductPlanService.getOne(new LambdaQueryWrapper().eq(ZyProductPlan::getProductCode, productRecord.getOrderCode())); -// Optional.ofNullable(productPlan).orElseThrow(() -> new JeecgBootException("工单编号:" + productRecord.getOrderCode() + "不存在!")); -// List zyPlanProcessList = iZyPlanProcessService.list(new LambdaQueryWrapper() -// .eq(ZyPlanProcess::getPlanId, productPlan.getId()) -// .eq(ZyPlanProcess::getStationId, obj.getId()) -// ); -// if (!ObjectUtils.isEmpty(zyPlanProcessList)) { -// ZyPlanProcess zyPlanProcess = zyPlanProcessList.get(0); -// ProductRecordVo vo = new ProductRecordVo(); -// vo.setProductCode(productRecord.getOrderCode()); -// vo.setProcessName(zyPlanProcess.getProcessName()); -// vo.setStationName(zyPlanProcess.getStationName()); -// vo.setMachineNames(zyPlanProcess.getMachineNames()); -// vo.setStationNum(zyPlanProcess.getStationNum()); -// productRecordVos.add(vo); -// } else { -// ProductRecordVo vo = new ProductRecordVo(); -// vo.setStationName(obj.getStationName()); -// vo.setStationNum(obj.getStationNum()); -// productRecordVos.add(vo); -// } -// } else { -// ProductRecordVo vo = new ProductRecordVo(); -// vo.setStationName(obj.getStationName()); -// vo.setStationNum(obj.getStationNum()); -// productRecordVos.add(vo); -// } -// }); -// SysDepart depart = iSysDepartService.getOne(new LambdaQueryWrapper().eq(SysDepart::getId, station.getDepartId())); -//// productRecordVos.stream().map(o -> o.getStationNum()).collect(Collectors.toList()); -// departMap.put(depart.getDepartName(), productRecordVos); -// shengchanxianMap.putAll(departMap); -// }); -// } -// resultMap.put("shengchanxian_data", shengchanxianMap); + + +// List zyPlanProcessList = iZyPlanProcessService.list(new QueryWrapper().eq("DATE_FORMAT (create_time,'%Y-%m-%d ')", LocalDate.now())); + List zyPlanProcessList = iZyPlanProcessService.list(new QueryWrapper().eq("DATE_FORMAT (create_time,'%Y-%m-%d ')", "2023-06-03")); + Map countMachineIdMap = new HashMap<>(); + Map deviceData = new HashMap<>(); + Optional.ofNullable(zyPlanProcessList).orElse(new LinkedList<>()).forEach(e -> { + String machineIds = e.getMachineIds(); + if (machineIds.contains(",")) { + //该工序有多个设备 + String[] machineIdArrs = machineIds.split(","); + for (String machineId : machineIdArrs) { + Integer countByMachineId = countMachineIdMap.getOrDefault(machineId, 0); + countMachineIdMap.put(machineId, countByMachineId.intValue() + 1); + } + } else { + Integer countByMachineIds = countMachineIdMap.getOrDefault(machineIds, 0); + countMachineIdMap.put(machineIds, countByMachineIds.intValue() + 1); + } + }); + + countMachineIdMap.forEach((k, v) -> { + ZyDevice zyDevice = iZyDeviceService.getById(k); + if (!ObjectUtils.isEmpty(zyDevice)) { + Map deviceMap = new LinkedHashMap<>(); + deviceMap.put("code", zyDevice.getCode()); + deviceMap.put("name", zyDevice.getName()); + deviceMap.put("status", "正常"); + //负载 + deviceMap.put("ratio", getRatioStr(v, zyDevice.getVal())); + deviceData.put(zyDevice.getCode(), deviceMap); + } + }); + resultMap.put("shebeixinxi_", deviceData); return resultMap; } @@ -139,21 +172,11 @@ public class ProductionLargeServiceImpl implements ProductionLargeService { .eq(Station::getDepartId, station.getDepartId()) .orderByAsc(Station::getStationNum) ); - /** - * 取每个工位的,生产记录状态0(生产中)的最新一条数据 - */ List productRecordVos = new LinkedList<>(); Optional.ofNullable(stationList).orElse(new LinkedList<>()).forEach(obj -> { -// ProductRecord productRecord = iProductRecordService.getOne(new LambdaQueryWrapper() -// .eq(ProductRecord::getStationId, obj.getId()) -// .eq(ProductRecord::getStatus, "0") -// .orderByDesc(ProductRecord::getCreateTime) -// .last("limit 1") -// ); - //查询生产计划工序表,对应设备状态 为生产中的数据 + //取每个工位上最新一条工序信息 ZyPlanProcess zyPlanProcess = iZyPlanProcessService.getOne(new LambdaQueryWrapper() .eq(ZyPlanProcess::getStationId, obj.getId()) -// .eq(ZyPlanProcess::getStatus,"1")) .orderByDesc(ZyPlanProcess::getUpdateTime) .last("limit 1")); if (!ObjectUtils.isEmpty(zyPlanProcess)) { @@ -162,15 +185,23 @@ public class ProductionLargeServiceImpl implements ProductionLargeService { ProductRecordVo vo = new ProductRecordVo(); if (!ObjectUtils.isEmpty(productPlan)) { vo.setWorkOrder(productPlan.getProductNo()); + Groupx groupx = iGroupxService.getById(productPlan.getTeamId()); + vo.setTeamName(groupx.getGroupName()); } vo.setProcessName(zyPlanProcess.getProcessName()); vo.setStationName(zyPlanProcess.getStationName()); vo.setMachineNames(zyPlanProcess.getMachineNames()); vo.setStationNum(zyPlanProcess.getStationNum()); vo.setProcessStatus(zyPlanProcess.getStatus()); - vo.setPlanProcessInfo(zyPlanProcess); + ZyPlanProcessVo zyPlanProcessVo = new ZyPlanProcessVo(); + BeanUtils.copyProperties(zyPlanProcess, zyPlanProcessVo); + ZyProcess zyProcess = iZyProcessService.getById(zyPlanProcess.getProcessId()); + if (!ObjectUtils.isEmpty(zyProcess)) { + zyPlanProcessVo.setImage(zyProcess.getImage()); + } + vo.setZyPlanProcessVo(zyPlanProcessVo); productRecordVos.add(vo); - } else { + } else { //没有工序返回工位信息 ProductRecordVo vo = new ProductRecordVo(); vo.setStationName(obj.getStationName()); vo.setStationNum(obj.getStationNum()); @@ -182,7 +213,7 @@ public class ProductionLargeServiceImpl implements ProductionLargeService { shengchanxianMap.putAll(departMap); }); } - resultMap.put("shengchanxian_data", shengchanxianMap); + resultMap.put("shengchanxian_", shengchanxianMap); return resultMap; } } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/vo/ProductRecordVo.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/vo/ProductRecordVo.java index 9be807c2..7f1aa8ce 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/vo/ProductRecordVo.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/vo/ProductRecordVo.java @@ -3,7 +3,7 @@ package org.jeecg.modules.largeScreen.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import org.jeecg.modules.productplan.entity.ZyPlanProcess; +import org.jeecg.modules.productplan.entity.vo.ZyPlanProcessVo; import org.jeecgframework.poi.excel.annotation.Excel; import java.io.Serializable; @@ -50,11 +50,14 @@ public class ProductRecordVo implements Serializable { @ApiModelProperty(value = "工单编号") private String workOrder; + @ApiModelProperty(value = "班组") + private String teamName; + private Integer stationNum; @ApiModelProperty(value = "工位工序状态") private Integer processStatus; - @ApiModelProperty(value = "工序信息") - private ZyPlanProcess planProcessInfo; + @ApiModelProperty(value = "工序信息Vo") + private ZyPlanProcessVo zyPlanProcessVo; } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/controller/ZySpeechMessageController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/controller/ZySpeechMessageController.java index 443391ac..2121bd4f 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/controller/ZySpeechMessageController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/controller/ZySpeechMessageController.java @@ -52,7 +52,7 @@ public class ZySpeechMessageController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(zySpeechMessage, req.getParameterMap()); - queryWrapper.orderByAsc("create_time"); + queryWrapper.orderByDesc("create_time"); Page page = new Page(pageNo, pageSize); IPage pageList = zySpeechMessageService.page(page, queryWrapper); return Result.OK(pageList); diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ZyPlanProcessVo.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ZyPlanProcessVo.java new file mode 100644 index 00000000..1a548a6c --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ZyPlanProcessVo.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.productplan.entity.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.jeecg.modules.productplan.entity.ZyPlanProcess; + +@Data +@ApiModel(value="ZyPlanProcessVo", description="ZyPlanProcessVo") +public class ZyPlanProcessVo extends ZyPlanProcess { + + @ApiModelProperty(value = "工序图片") + private String image; +} From f61e1f51a081849af8dd5a18dcdae68ec1e65758 Mon Sep 17 00:00:00 2001 From: Gitea Date: Wed, 7 Jun 2023 16:59:02 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/zyplanprocess/ZyPlanProcessList.vue | 48 ++++++++++++++++++- .../controller/ZyPlanProcessController.java | 9 ++++ .../productplan/entity/ZyPlanProcess.java | 9 ++++ 3 files changed, 64 insertions(+), 2 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/zyplanprocess/ZyPlanProcessList.vue b/ant-design-vue-jeecg/src/views/zyplanprocess/ZyPlanProcessList.vue index 6a1b745f..0b17493c 100644 --- a/ant-design-vue-jeecg/src/views/zyplanprocess/ZyPlanProcessList.vue +++ b/ant-design-vue-jeecg/src/views/zyplanprocess/ZyPlanProcessList.vue @@ -55,6 +55,12 @@ + + @@ -113,12 +121,17 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' import ZyPlanProcessModal from './modules/ZyPlanProcessModal' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' + import StationModal1 from "../team/modules/StationModal1"; + import WorkOrderModal from "../workorder/modules/WorkOrderModal"; + import {deleteAction, getAction} from "@api/manage"; export default { name: 'ZyPlanProcessList', mixins:[JeecgListMixin, mixinDevice], components: { - ZyPlanProcessModal + ZyPlanProcessModal, + StationModal1, + WorkOrderModal }, data () { return { @@ -135,6 +148,17 @@ return parseInt(index)+1; } }, + { + title:'工单编号', + align:"center", + dataIndex: 'productNo', + scopedSlots: {customRender: 'gd'} + }, + { + title:'产品名称', + align:"center", + dataIndex: 'productCode_dictText' + }, { title:'工序名称', align:"center", @@ -143,7 +167,8 @@ { title:'工位名称', align:"center", - dataIndex: 'stationName' + dataIndex: 'stationName', + scopedSlots: {customRender: 'gw'} }, { title:'工位序号', @@ -223,6 +248,25 @@ }, }, methods: { + gw(stationId){ + getAction("/team/station/queryById", {id: stationId}).then((res) => { + if (res.success) { + this.$refs.modalFormgw.edit(res.result); + this.$refs.modalFormgw.title="详情"; + } else { + } + }) + }, + gd(orderCode){ + getAction("/workOrder/workOrder/queryByOrderCode", {orderCode: orderCode}).then((res) => { + if (res.success) { + this.$refs.modalFormgd.edit(res.result); + this.$refs.modalFormgd.title="详情"; + this.$refs.modalFormgd.disableSubmit = true; + } else { + } + }) + }, initDictConfig(){ }, } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java index d5008bfa..bed70015 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java @@ -19,8 +19,10 @@ import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.modules.productplan.entity.ZyPlanProcess; +import org.jeecg.modules.productplan.entity.ZyProductPlan; import org.jeecg.modules.productplan.entity.vo.ProcessDataVo; import org.jeecg.modules.productplan.service.IZyPlanProcessService; +import org.jeecg.modules.productplan.service.IZyProductPlanService; import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.service.ISysUserService; import org.jeecg.modules.team.entity.Station; @@ -59,6 +61,8 @@ public class ZyPlanProcessController extends JeecgController useridstationid = new HashMap(){{ put("GW01","1600683844590194690"); @@ -379,6 +383,11 @@ public class ZyPlanProcessController extends JeecgController page = new Page(pageNo, pageSize); IPage pageList = zyPlanProcessService.page(page, queryWrapper); + for(int i = 0 ; i < pageList.getRecords().size() ; i++){ + ZyProductPlan zyProductPlan = zyProductPlanService.getById(pageList.getRecords().get(i).getPlanId()); + pageList.getRecords().get(i).setProductCode(zyProductPlan.getProductNo()); + pageList.getRecords().get(i).setProductNo(zyProductPlan.getProductCode()); + } return Result.OK(pageList); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java index 73e5e3f6..1e695d68 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java @@ -96,6 +96,15 @@ public class ZyPlanProcess implements Serializable { @TableField(exist = false) private List userIdList; + + @TableField(exist = false) + private String productNo; + + @TableField(exist = false) + @Dict(dictTable = "zy_product", dicText = "product_name", dicCode = "product_code") + private String productCode; + + /** * 设备id列表 */