2023-05-17-01-大屏

master
喻忠伟 2 years ago
parent 1f7dda1573
commit 89ae331599
  1. 8
      ant-design-vue-jeecg/.env.production
  2. 460
      ant-design-vue-jeecg/src/views/productrecord/ProductRecordList.vue
  3. 10
      jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/CommonUtils.java
  4. 2
      jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/XJobUtils.java
  5. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java
  6. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/impl/HangerLocationServiceImpl.java
  7. 86
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/controller/LargeScreenController.java
  8. 41
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/vo/LargeOrderVo.java
  9. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java

@ -1,4 +1,4 @@
NODE_ENV=production NODE_ENV=production
VUE_APP_API_BASE_URL=http://182.92.169.222:10085/jeecg-boot VUE_APP_API_BASE_URL=http://10.100.200.112:10085/jeecg-boot
VUE_APP_CAS_BASE_URL=http://182.92.169.222:10085/jeecg-boot/cas VUE_APP_CAS_BASE_URL=http://10.100.200.112:10085/jeecg-boot/cas
VUE_APP_ONLINE_BASE_URL=http://182.92.169.222:8012 VUE_APP_ONLINE_BASE_URL=http://10.100.200.112:8012

@ -1,231 +1,231 @@
<template> <template>
<a-card :bordered="false"> <a-card :bordered="false">
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="工位"> <a-form-item label="工位">
<j-search-select-tag placeholder="请选择工位" v-model="queryParam.stationId" dict="station,station_name,id"/> <j-search-select-tag placeholder="请选择工位" v-model="queryParam.stationId" dict="station,station_name,id"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="工单编号"> <a-form-item label="工单编号">
<j-popup placeholder="请选择工单编号" v-model="queryParam.orderCode" code="findgdbh" org-fields="id,orders_num" dest-fields="order_id,order_code" :field="getPopupField('order_id,order_code')" :multi="true"/> <j-popup placeholder="请选择工单编号" v-model="queryParam.orderCode" code="findgdbh" org-fields="id,orders_num" dest-fields="order_id,order_code" :field="getPopupField('order_id,order_code')" :multi="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<template v-if="toggleSearchStatus"> <template v-if="toggleSearchStatus">
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="状态"> <a-form-item label="状态">
<j-dict-select-tag placeholder="请选择状态" v-model="queryParam.status" dictCode="cgqzt"/> <j-dict-select-tag placeholder="请选择状态" v-model="queryParam.status" dictCode="cgqzt"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</template> </template>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px"> <a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }} {{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a> </a>
</span> </span>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
<!-- 查询区域-END --> <!-- 查询区域-END -->
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('生产记录表')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('生产记录表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button> <a-button type="primary" icon="import">导入</a-button>
</a-upload> </a-upload>
<!-- 高级查询区域 --> <!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu> </a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown> </a-dropdown>
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->
<div> <div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a> <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a> <a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div> </div>
<a-table <a-table
ref="table" ref="table"
size="middle" size="middle"
:scroll="{x:true}" :scroll="{x:true}"
bordered bordered
rowKey="id" rowKey="id"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap" class="j-table-force-nowrap"
@change="handleTableChange"> @change="handleTableChange">
<template slot="htmlSlot" slot-scope="text"> <template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div> <div v-html="text"></div>
</template> </template>
<template slot="imgSlot" slot-scope="text"> <template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template> </template>
<template slot="fileSlot" slot-scope="text"> <template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button <a-button
v-else v-else
:ghost="true" :ghost="true"
type="primary" type="primary"
icon="download" icon="download"
size="small" size="small"
@click="downloadFile(text)"> @click="downloadFile(text)">
下载 下载
</a-button> </a-button>
</template> </template>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-dropdown> <a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a> <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item> <a-menu-item>
<a @click="handleDetail(record)">详情</a> <a @click="handleDetail(record)">详情</a>
</a-menu-item> </a-menu-item>
<a-menu-item> <a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</a-dropdown> </a-dropdown>
</span> </span>
</a-table> </a-table>
</div> </div>
<product-record-modal ref="modalForm" @ok="modalFormOk"></product-record-modal> <product-record-modal ref="modalForm" @ok="modalFormOk"></product-record-modal>
</a-card> </a-card>
</template> </template>
<script> <script>
import '@/assets/less/TableExpand.less' import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin' import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ProductRecordModal from './modules/ProductRecordModal' import ProductRecordModal from './modules/ProductRecordModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
export default { export default {
name: 'ProductRecordList', name: 'ProductRecordList',
mixins:[JeecgListMixin, mixinDevice], mixins:[JeecgListMixin, mixinDevice],
components: { components: {
ProductRecordModal ProductRecordModal
}, },
data () { data () {
return { return {
description: '生产记录表管理页面', description: '生产记录表管理页面',
// //
columns: [ columns: [
{ {
title: '#', title: '#',
dataIndex: '', dataIndex: '',
key:'rowIndex', key:'rowIndex',
width:60, width:60,
align:"center", align:"center",
customRender:function (t,r,index) { customRender:function (t,r,index) {
return parseInt(index)+1; return parseInt(index)+1;
} }
}, },
{ {
title:'工位', title:'工位',
align:"center", align:"center",
dataIndex: 'stationId_dictText' dataIndex: 'stationId_dictText'
}, },
{ {
title:'工单编号', title:'工单编号',
align:"center", align:"center",
dataIndex: 'orderId_dictText' dataIndex: 'orderCode'
}, },
{ {
title:'生产开始时间', title:'生产开始时间',
align:"center", align:"center",
dataIndex: 'workTime' dataIndex: 'workTime'
}, },
{ {
title:'生产结束时间', title:'生产结束时间',
align:"center", align:"center",
dataIndex: 'offTime' dataIndex: 'offTime'
}, },
{ {
title:'时长', title:'时长',
align:"center", align:"center",
dataIndex: 'duration' dataIndex: 'duration'
}, },
{ {
title:'状态', title:'状态',
align:"center", align:"center",
dataIndex: 'status_dictText' dataIndex: 'status_dictText'
}, },
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
align:"center", align:"center",
fixed:"right", fixed:"right",
width:147, width:147,
scopedSlots: { customRender: 'action' } scopedSlots: { customRender: 'action' }
} }
], ],
url: { url: {
list: "/productrecord/productRecord/list", list: "/productrecord/productRecord/list",
delete: "/productrecord/productRecord/delete", delete: "/productrecord/productRecord/delete",
deleteBatch: "/productrecord/productRecord/deleteBatch", deleteBatch: "/productrecord/productRecord/deleteBatch",
exportXlsUrl: "/productrecord/productRecord/exportXls", exportXlsUrl: "/productrecord/productRecord/exportXls",
importExcelUrl: "productrecord/productRecord/importExcel", importExcelUrl: "productrecord/productRecord/importExcel",
}, },
dictOptions:{}, dictOptions:{},
superFieldList:[], superFieldList:[],
} }
}, },
created() { created() {
this.getSuperFieldList(); this.getSuperFieldList();
}, },
computed: { computed: {
importExcelUrl: function(){ importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
}, },
}, },
methods: { methods: {
initDictConfig(){ initDictConfig(){
}, },
getSuperFieldList(){ getSuperFieldList(){
let fieldList=[]; let fieldList=[];
fieldList.push({type:'sel_search',value:'stationId',text:'工位',dictTable:'station', dictText:'station_name', dictCode:'id'}) fieldList.push({type:'sel_search',value:'stationId',text:'工位',dictTable:'station', dictText:'station_name', dictCode:'id'})
fieldList.push({type:'popup',value:'stationName',text:'工位', popup:{code:'findgw',field:'id',orgFields:'id',destFields:'station_id'}}) fieldList.push({type:'popup',value:'stationName',text:'工位', popup:{code:'findgw',field:'id',orgFields:'id',destFields:'station_id'}})
fieldList.push({type:'popup',value:'orderCode',text:'工单编号', popup:{code:'findgdbh',field:'id',orgFields:'id',destFields:'order_id'}}) fieldList.push({type:'popup',value:'orderCode',text:'工单编号', popup:{code:'findgdbh',field:'id',orgFields:'id',destFields:'order_id'}})
fieldList.push({type:'sel_search',value:'orderId',text:'工单编号',dictTable:'work_order', dictText:'product_code', dictCode:'id'}) fieldList.push({type:'sel_search',value:'orderId',text:'工单编号',dictTable:'work_order', dictText:'product_code', dictCode:'id'})
fieldList.push({type:'datetime',value:'workTime',text:'生产开始时间'}) fieldList.push({type:'datetime',value:'workTime',text:'生产开始时间'})
fieldList.push({type:'datetime',value:'offTime',text:'生产结束时间'}) fieldList.push({type:'datetime',value:'offTime',text:'生产结束时间'})
fieldList.push({type:'string',value:'duration',text:'时长',dictCode:''}) fieldList.push({type:'string',value:'duration',text:'时长',dictCode:''})
fieldList.push({type:'string',value:'status',text:'状态',dictCode:'cgqzt'}) fieldList.push({type:'string',value:'status',text:'状态',dictCode:'cgqzt'})
this.superFieldList = fieldList this.superFieldList = fieldList
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
</style> </style>

@ -212,4 +212,14 @@ public class CommonUtils {
return DB_TYPE; return DB_TYPE;
} }
/** 截取后6字符串 */
public static String getLastSixChars(String str,int num) {
if (!str.isEmpty() && str.length() > num) {
return str.substring(str.length() - num);
} else {
// 字符串为空或长度不足6位,返回原字符串
return str;
}
}
} }

@ -30,7 +30,7 @@ public class XJobUtils{
//将时间转为long类型 //将时间转为long类型
long start=start_Date.getTime(); long start=start_Date.getTime();
//获取30-180秒对应毫秒 //获取30-180秒对应毫秒
long intervalTime=randInt(s*60,s*60)*1000; long intervalTime=randInt(s*60,e*60)*1000;
//总共花费时长 //总共花费时长
long timeMillis =start+intervalTime; long timeMillis =start+intervalTime;

@ -1,6 +1,7 @@
package org.jeecg.modules.demo.zyorders.service.impl; package org.jeecg.modules.demo.zyorders.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.common.util.CommonUtils;
import org.jeecg.modules.demo.customerinvoice.entity.CustomerInvoice; import org.jeecg.modules.demo.customerinvoice.entity.CustomerInvoice;
import org.jeecg.modules.demo.customerinvoice.mapper.CustomerInvoiceMapper; import org.jeecg.modules.demo.customerinvoice.mapper.CustomerInvoiceMapper;
import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress; import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress;
@ -323,7 +324,7 @@ public class ZyOrdersServiceImpl extends ServiceImpl<ZyOrdersMapper, ZyOrders> i
// message.setZyplanprocessId(); // message.setZyplanprocessId();
//消息 //消息
String ordersNum = zo.getOrdersNum(); String ordersNum = zo.getOrdersNum();
String code = ordersNum.substring(ordersNum.length() - 6); String code =CommonUtils.getLastSixChars(ordersNum,6);
message.setMessage("您有新的订单,订单尾号:" + code + ",请及时查看!"); message.setMessage("您有新的订单,订单尾号:" + code + ",请及时查看!");
zySpeechMessageMapper.insert(message); zySpeechMessageMapper.insert(message);
} }

@ -178,7 +178,7 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
Sensor sr=senIn.get(0); Sensor sr=senIn.get(0);
SensorRecord srmodel=new SensorRecord(); SensorRecord srmodel=new SensorRecord();
//传感器编号 //传感器编号
srmodel.setSensorCode(sr.getSensorCode()); srmodel.setSensorCode(sr.getId());
//网络地址 //网络地址
srmodel.setSensorIp(sr.getSensorIp()); srmodel.setSensorIp(sr.getSensorIp());
//工位 //工位
@ -186,7 +186,7 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
//进出标记 //进出标记
srmodel.setIiOsign("1"); srmodel.setIiOsign("1");
//产品标识 //产品标识
//srmodel.setProductIdenti(); srmodel.setProductIdenti(item.getProductCode());
//触发时间 //触发时间
srmodel.setTriggerTime(str01); srmodel.setTriggerTime(str01);
arrSR.add(srmodel); arrSR.add(srmodel);
@ -200,7 +200,7 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
Sensor sr=senIn.get(0); Sensor sr=senIn.get(0);
SensorRecord srmodel=new SensorRecord(); SensorRecord srmodel=new SensorRecord();
//传感器编号 //传感器编号
srmodel.setSensorCode(sr.getSensorCode()); srmodel.setSensorCode(sr.getId());
//网络地址 //网络地址
srmodel.setSensorIp(sr.getSensorIp()); srmodel.setSensorIp(sr.getSensorIp());
//工位 //工位
@ -208,7 +208,7 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
//进出标记 //进出标记
srmodel.setIiOsign("1"); srmodel.setIiOsign("1");
//产品标识 //产品标识
//srmodel.setProductIdenti(); srmodel.setProductIdenti(item.getProductCode());
//触发时间 //触发时间
srmodel.setTriggerTime(str01); srmodel.setTriggerTime(str01);
arrSR.add(srmodel); arrSR.add(srmodel);

@ -6,16 +6,27 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure;
import org.jeecg.modules.demo.customermeasure.service.ICustomerMeasureService;
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods;
import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; import org.jeecg.modules.demo.zyorders.service.IZyOrdersService;
import org.jeecg.modules.largeScreen.vo.LargeOrderVo;
import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo; import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo;
import org.jeecg.modules.shop.vo.OrderSales; import org.jeecg.modules.shop.vo.OrderSales;
import org.jeecg.modules.system.entity.SysDepart; import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysDepartService; import org.jeecg.modules.system.service.ISysDepartService;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.zystylemodule.entity.NewStyleModule;
import org.jeecg.modules.zystylemodule.entity.ZyStyleModule;
import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
@ -27,10 +38,25 @@ import java.util.List;
@RestController @RestController
@Slf4j @Slf4j
public class LargeScreenController { public class LargeScreenController {
//订单
@Autowired
private IZyOrdersService zyOrdersService;
//商品
@Autowired
private IOrderGoodsService orderGoodsService;
//用户
@Autowired @Autowired
private IZyOrdersService zyOrdersService; private ISysUserService sysUserService;
// 测体
@Autowired
private ICustomerMeasureService customerMeasureService;
//模块
@Autowired
private IZyStyleModuleService zyStyleModuleService;
@Autowired @Autowired
private ISysDepartService sysDepartService; private ISysDepartService sysDepartService;
@ -114,5 +140,63 @@ public class LargeScreenController {
return Result.OK(list); return Result.OK(list);
} }
@AutoLog(value = "获取最新订单")
@ApiOperation(value = "获取最新订单", notes = "获取最新订单")
@GetMapping("/getNewOder")
public Result<?> getNewOder() {
LargeOrderVo vo=new LargeOrderVo();
//最新订单
QueryWrapper<ZyOrders> queryWrapper=new QueryWrapper();
queryWrapper.eq("ischild",1);
queryWrapper.eq("payment_status",1);
queryWrapper.orderByDesc("order_time");
List<ZyOrders> list=zyOrdersService.list(queryWrapper);
//取最新一條數據
if(list.size()>0)
{
ZyOrders orders_model=list.get(0);
vo.setOrders(orders_model);
//顾客信息-性别只能查询用户表
SysUser user=sysUserService.getById(orders_model.getUserId());
vo.setUser(user);
//测体数据,可能有多条,只能取最新的
QueryWrapper<CustomerMeasure> cmqw=new QueryWrapper();
cmqw.eq("user_id",orders_model.getUserId());
cmqw.orderByDesc("create_time");
List<CustomerMeasure> cmList=customerMeasureService.list(cmqw);
CustomerMeasure cmModel=new CustomerMeasure();
if(cmList.size()>0)
{
cmModel=cmList.get(0);
vo.setCustomerMeasure(cmModel);
}
//订单商品
QueryWrapper<OrderGoods> ogqw=new QueryWrapper();
ogqw.eq("orders_id",orders_model.getId());
List<OrderGoods> ogList=orderGoodsService.list(ogqw);
OrderGoods ogModel= new OrderGoods();
//订单中找款式
if(ogList.size()>0)
{
ogModel=ogList.get(0);
String[] picArr=ogModel.getGoodsPicture().split(",");
java.util.ArrayList<String> picList = new ArrayList<>(Arrays.asList(picArr));
vo.setPictureList(picList);
vo.setOrderGoods(ogModel);
//服装款式-模块
QueryWrapper<ZyStyleModule> smqw=new QueryWrapper();
smqw.eq("style_id",ogModel.getStyleId());
List<ZyStyleModule> smList=zyStyleModuleService.list(smqw);
List<NewStyleModule> newStyleModuleList =zyStyleModuleService.changeList(smList);
vo.setModuleList(newStyleModuleList);
System.out.println("");
}
}
return Result.OK(vo);
}
} }

@ -0,0 +1,41 @@
package org.jeecg.modules.largeScreen.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure;
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.zystylemodule.entity.NewStyleModule;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
import java.util.List;
@Data
public class LargeOrderVo implements Serializable {
private static final long serialVersionUID = 1L;
//订单用户
private SysUser user;
//订单
private ZyOrders orders;
//商品
private OrderGoods orderGoods;
//测体
private CustomerMeasure customerMeasure;
//模块
private List<NewStyleModule> moduleList;
//商品图片
private List<String> pictureList;
}

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.util.CommonUtils;
import org.jeecg.modules.demo.base.mapper.ZyProcessMapper; import org.jeecg.modules.demo.base.mapper.ZyProcessMapper;
import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure; import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure;
import org.jeecg.modules.demo.customermeasure.mapper.CustomerMeasureMapper; import org.jeecg.modules.demo.customermeasure.mapper.CustomerMeasureMapper;
@ -259,7 +260,7 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
message.setWorkorderId(workOrder.getId()); message.setWorkorderId(workOrder.getId());
//消息 //消息
String productCode = workOrder.getProductCode(); String productCode = workOrder.getProductCode();
String code = productCode.substring(productCode.length() - 6); String code = CommonUtils.getLastSixChars(productCode,6);
message.setMessage("您的工单已生成,工单尾号:"+code+",请及时查看!"); message.setMessage("您的工单已生成,工单尾号:"+code+",请及时查看!");
zySpeechMessageMapper.insert(message); zySpeechMessageMapper.insert(message);

Loading…
Cancel
Save