diff --git a/ant-design-vue-jeecg/src/views/zyplanprocess/ZyPlanProcessList.vue b/ant-design-vue-jeecg/src/views/zyplanprocess/ZyPlanProcessList.vue index 0b17493c..9a99ca3a 100644 --- a/ant-design-vue-jeecg/src/views/zyplanprocess/ZyPlanProcessList.vue +++ b/ant-design-vue-jeecg/src/views/zyplanprocess/ZyPlanProcessList.vue @@ -61,6 +61,15 @@ + + + @@ -124,6 +141,10 @@ import StationModal1 from "../team/modules/StationModal1"; import WorkOrderModal from "../workorder/modules/WorkOrderModal"; import {deleteAction, getAction} from "@api/manage"; + import ZyProductModal from "../zyWorkProduct/modules/ZyProductModal"; + import ZyProcessDetail from "../process/modules/ZyProcessDetail"; + import ZyDeviceDetail from "../device/modules/ZyDeviceDetail"; + import ZyPlanProcessList1 from './ZyPlanProcessList1' export default { name: 'ZyPlanProcessList', @@ -131,7 +152,11 @@ components: { ZyPlanProcessModal, StationModal1, - WorkOrderModal + WorkOrderModal, + ZyProductModal, + ZyProcessDetail, + ZyDeviceDetail, + ZyPlanProcessList1 }, data () { return { @@ -157,12 +182,14 @@ { title:'产品名称', align:"center", - dataIndex: 'productCode_dictText' + dataIndex: 'productCode_dictText', + scopedSlots: {customRender: 'cp'} }, { title:'工序名称', align:"center", - dataIndex: 'processName' + dataIndex: 'processName', + scopedSlots: {customRender: 'gx'} }, { title:'工位名称', @@ -178,7 +205,8 @@ { title:'设备名称', align:"center", - dataIndex: 'machineNames' + dataIndex: 'machineNames', + scopedSlots: {customRender: 'sb'} }, /* { title:'工具名称', @@ -267,6 +295,22 @@ } }) }, + cp(productCode){ + getAction("/zyproduct/zyProduct/queryByProductCode", {productCode: productCode}).then((res) => { + if (res.success) { + this.$refs.modalFormcp.edit(res.result); + this.$refs.modalFormcp.title="详情"; + this.$refs.modalFormcp.disableSubmit = true; + } else { + } + }) + }, + gx(processId){ + this.$refs.zyProcessDetail.showModal(processId); + }, + sb(machineIds){ + this.$refs.ZyDeviceDetail.showModal(machineIds.split(",")[0]); + }, initDictConfig(){ }, } diff --git a/ant-design-vue-jeecg/src/views/zyplanprocess/ZyPlanProcessList1.vue b/ant-design-vue-jeecg/src/views/zyplanprocess/ZyPlanProcessList1.vue new file mode 100644 index 00000000..94f20104 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/zyplanprocess/ZyPlanProcessList1.vue @@ -0,0 +1,314 @@ + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrders.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrders.java index 77184eb9..414ffecf 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrders.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrders.java @@ -1,211 +1,293 @@ -package org.jeecg.modules.demo.zyorders.entity; - -import java.io.Serializable; -import java.io.UnsupportedEncodingException; -import java.util.Date; -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import org.jeecgframework.poi.excel.annotation.Excel; -import org.jeecg.common.aspect.annotation.Dict; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - * @Description: 订单基本信息管理 - * @Author: jeecg-boot - * @Date: 2022-12-26 - * @Version: V1.0 - */ -@Data -@TableName("zy_orders") -@Accessors(chain = true) -@EqualsAndHashCode(callSuper = false) -@ApiModel(value="zy_orders对象", description="订单基本信息管理") -public class ZyOrders implements Serializable { - private static final long serialVersionUID = 1L; - - /**主键*/ - @TableId(type = IdType.ASSIGN_ID) - @ApiModelProperty(value = "主键") - private java.lang.String id; - /**创建人*/ - @ApiModelProperty(value = "创建人") - private java.lang.String createBy; - /**创建日期*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @ApiModelProperty(value = "创建日期") - private java.util.Date createTime; - /**更新人*/ - @ApiModelProperty(value = "更新人") - private java.lang.String updateBy; - /**更新日期*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @ApiModelProperty(value = "更新日期") - private java.util.Date updateTime; - /**所属部门*/ - @ApiModelProperty(value = "所属部门") - private java.lang.String sysOrgCode; - /**是否子单*/ - @Excel(name = "是否子单", width = 15, dicCode = "ischild") - @Dict(dicCode = "ischild") - @ApiModelProperty(value = "是否子单") - private java.lang.Integer ischild; - /**原订单id*/ - @Excel(name = "原订单id", width = 15) - @Dict(dictTable = "zy_orders", dicText = "orders_num", dicCode = "id") - @ApiModelProperty(value = "原订单id") - private java.lang.String orderId; - /**下单时间*/ - @Excel(name = "下单时间", width = 15, format = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @ApiModelProperty(value = "下单时间") - private java.util.Date orderTime; - /**订单编号*/ - @Excel(name = "订单编号", width = 15) - @ApiModelProperty(value = "订单编号") - private java.lang.String ordersNum; - /**总金额*/ - @Excel(name = "总金额", width = 15) - @ApiModelProperty(value = "总金额") - private java.lang.Double money; - /**运费*/ - @Excel(name = "运费", width = 15) - @ApiModelProperty(value = "运费") - private java.lang.Double freight; - /**促销*/ - @Excel(name = "促销", width = 15) - @ApiModelProperty(value = "促销") - private java.lang.Double promotionPrice; - /**实付款*/ - @Excel(name = "实付款", width = 15) - @ApiModelProperty(value = "实付款") - private java.lang.Double actualPayment; - /**交货期*/ - @Excel(name = "交货期", width = 15) - @ApiModelProperty(value = "交货期") - private java.lang.Integer deliveryTime; - /**订单类型*/ - @Excel(name = "订单类型", width = 15, dicCode = "orders_type") - @Dict(dicCode = "orders_type") - @ApiModelProperty(value = "订单类型") - private java.lang.Integer ordersType; - /**顾客id*/ - @Excel(name = "顾客id", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") - @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id") - @ApiModelProperty(value = "顾客id") - private java.lang.String userId; - /**商品条目数量*/ - @Excel(name = "商品条目数量", width = 15) - @ApiModelProperty(value = "商品条目数量") - private java.lang.Integer goodsQuantity; - /**支付方式*/ - @Excel(name = "支付方式", width = 15, dicCode = "payment_method") - @Dict(dicCode = "payment_method") - @ApiModelProperty(value = "支付方式") - private java.lang.Integer paymentMethod; - /**支付状态*/ - @Excel(name = "支付状态", width = 15, dicCode = "payment_status") - @Dict(dicCode = "payment_status") - @ApiModelProperty(value = "支付状态") - private java.lang.Integer paymentStatus; - /**账号/卡号*/ - @Excel(name = "账号/卡号", width = 15) - @ApiModelProperty(value = "账号/卡号") - private java.lang.String accountNo; - /**开户银行*/ - @Excel(name = "开户银行", width = 15) - @ApiModelProperty(value = "开户银行") - private java.lang.String bankDeposit; - /**支付时间*/ - @Excel(name = "支付时间", width = 15, format = "yyyy-MM-dd hh:mm:ss") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @ApiModelProperty(value = "支付时间") - private java.util.Date paymentTime; - /**城市*/ - @Excel(name = "城市", width = 15) - @ApiModelProperty(value = "城市") - private java.lang.String cityId; - /**地址*/ - @Excel(name = "地址", width = 15) - @ApiModelProperty(value = "地址") - private java.lang.String address; - /**邮编*/ - @Excel(name = "邮编", width = 15) - @ApiModelProperty(value = "邮编") - private java.lang.String zipCode; - /**收货人*/ - @Excel(name = "收货人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") - @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") - @ApiModelProperty(value = "收货人") - private java.lang.String receiver; - /**联系电话*/ - @Excel(name = "联系电话", width = 15) - @ApiModelProperty(value = "联系电话") - private java.lang.String mobile; - /**发票客户类型*/ - @Excel(name = "发票客户类型", width = 15, dicCode = "invoice_customer_type") - @Dict(dicCode = "invoice_customer_type") - @ApiModelProperty(value = "发票客户类型") - private java.lang.Integer invoiceCustomerType; - /**发票类型*/ - @Excel(name = "发票类型", width = 15, dicCode = "invoice_type") - @Dict(dicCode = "invoice_type") - @ApiModelProperty(value = "发票类型") - private java.lang.Integer invoiceType; - /**纳税人识别号*/ - @Excel(name = "纳税人识别号", width = 15) - @ApiModelProperty(value = "纳税人识别号") - private java.lang.String taxIdentificationNumber; - /**开票地址*/ - @Excel(name = "开票地址", width = 15) - @ApiModelProperty(value = "开票地址") - private java.lang.String addressBilling; - /**电话*/ - @Excel(name = "电话", width = 15) - @ApiModelProperty(value = "电话") - private java.lang.String telephone; - /**公户开户行*/ - @Excel(name = "公户开户行", width = 15) - @ApiModelProperty(value = "公户开户行") - private java.lang.String bankPublic; - /**公户账号*/ - @Excel(name = "公户账号", width = 15) - @ApiModelProperty(value = "公户账号") - private java.lang.String accountNumber; - /**销售门店*/ - @Excel(name = "销售门店", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") - @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") - @ApiModelProperty(value = "销售门店") - private java.lang.String salesEnterpriseId; - /**销售员*/ - @Excel(name = "销售员", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") - @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") - @ApiModelProperty(value = "销售员") - private java.lang.String salespersonId; - /**物流企业*/ - @Excel(name = "物流企业", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") - @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") - @ApiModelProperty(value = "物流企业") - private java.lang.String logisticsEnterprisesId; - /**交付状态*/ - @Excel(name = "交付状态", width = 15, dicCode = "delivery_status") - @Dict(dicCode = "delivery_status") - @ApiModelProperty(value = "交付状态") - private java.lang.Integer deliveryStatus; - - /**是否虚拟订单*/ - @Dict(dicCode = "isvirtual") - @ApiModelProperty(value = "是否虚拟订单") - private java.lang.String isvirtual; -} +package org.jeecg.modules.demo.zyorders.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 订单基本信息管理 + * @Author: jeecg-boot + * @Date: 2022-12-26 + * @Version: V1.0 + */ +@Data +@TableName("zy_orders") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "zy_orders对象", description = "订单基本信息管理") +public class ZyOrders implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /** + * 创建人 + */ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /** + * 创建日期 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /** + * 更新人 + */ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /** + * 更新日期 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /** + * 所属部门 + */ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + /** + * 是否子单 + */ + @Excel(name = "是否子单", width = 15, dicCode = "ischild") + @Dict(dicCode = "ischild") + @ApiModelProperty(value = "是否子单") + private java.lang.Integer ischild; + /** + * 原订单id + */ + @Excel(name = "原订单id", width = 15) + @Dict(dictTable = "zy_orders", dicText = "orders_num", dicCode = "id") + @ApiModelProperty(value = "原订单id") + private java.lang.String orderId; + /** + * 下单时间 + */ + @Excel(name = "下单时间", width = 15, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "下单时间") + private java.util.Date orderTime; + /** + * 订单编号 + */ + @Excel(name = "订单编号", width = 15) + @ApiModelProperty(value = "订单编号") + private java.lang.String ordersNum; + /** + * 总金额 + */ + @Excel(name = "总金额", width = 15) + @ApiModelProperty(value = "总金额") + private java.lang.Double money; + /** + * 运费 + */ + @Excel(name = "运费", width = 15) + @ApiModelProperty(value = "运费") + private java.lang.Double freight; + /** + * 促销 + */ + @Excel(name = "促销", width = 15) + @ApiModelProperty(value = "促销") + private java.lang.Double promotionPrice; + /** + * 实付款 + */ + @Excel(name = "实付款", width = 15) + @ApiModelProperty(value = "实付款") + private java.lang.Double actualPayment; + /** + * 交货期 + */ + @Excel(name = "交货期", width = 15) + @ApiModelProperty(value = "交货期") + private java.lang.Integer deliveryTime; + /** + * 订单类型 + */ + @Excel(name = "订单类型", width = 15, dicCode = "orders_type") + @Dict(dicCode = "orders_type") + @ApiModelProperty(value = "订单类型") + private java.lang.Integer ordersType; + /** + * 顾客id + */ + @Excel(name = "顾客id", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id") + @ApiModelProperty(value = "顾客id") + private java.lang.String userId; + /** + * 商品条目数量 + */ + @Excel(name = "商品条目数量", width = 15) + @ApiModelProperty(value = "商品条目数量") + private java.lang.Integer goodsQuantity; + /** + * 支付方式 + */ + @Excel(name = "支付方式", width = 15, dicCode = "payment_method") + @Dict(dicCode = "payment_method") + @ApiModelProperty(value = "支付方式") + private java.lang.Integer paymentMethod; + /** + * 支付状态 + */ + @Excel(name = "支付状态", width = 15, dicCode = "payment_status") + @Dict(dicCode = "payment_status") + @ApiModelProperty(value = "支付状态") + private java.lang.Integer paymentStatus; + /** + * 账号/卡号 + */ + @Excel(name = "账号/卡号", width = 15) + @ApiModelProperty(value = "账号/卡号") + private java.lang.String accountNo; + /** + * 开户银行 + */ + @Excel(name = "开户银行", width = 15) + @ApiModelProperty(value = "开户银行") + private java.lang.String bankDeposit; + /** + * 支付时间 + */ + @Excel(name = "支付时间", width = 15, format = "yyyy-MM-dd hh:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "支付时间") + private java.util.Date paymentTime; + /** + * 城市 + */ + @Excel(name = "城市", width = 15) + @ApiModelProperty(value = "城市") + private java.lang.String cityId; + /** + * 地址 + */ + @Excel(name = "地址", width = 15) + @ApiModelProperty(value = "地址") + private java.lang.String address; + /** + * 邮编 + */ + @Excel(name = "邮编", width = 15) + @ApiModelProperty(value = "邮编") + private java.lang.String zipCode; + /** + * 收货人 + */ + @Excel(name = "收货人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") + @ApiModelProperty(value = "收货人") + private java.lang.String receiver; + /** + * 联系电话 + */ + @Excel(name = "联系电话", width = 15) + @ApiModelProperty(value = "联系电话") + private java.lang.String mobile; + /** + * 发票客户类型 + */ + @Excel(name = "发票客户类型", width = 15, dicCode = "invoice_customer_type") + @Dict(dicCode = "invoice_customer_type") + @ApiModelProperty(value = "发票客户类型") + private java.lang.Integer invoiceCustomerType; + /** + * 发票类型 + */ + @Excel(name = "发票类型", width = 15, dicCode = "invoice_type") + @Dict(dicCode = "invoice_type") + @ApiModelProperty(value = "发票类型") + private java.lang.Integer invoiceType; + /** + * 纳税人识别号 + */ + @Excel(name = "纳税人识别号", width = 15) + @ApiModelProperty(value = "纳税人识别号") + private java.lang.String taxIdentificationNumber; + /** + * 开票地址 + */ + @Excel(name = "开票地址", width = 15) + @ApiModelProperty(value = "开票地址") + private java.lang.String addressBilling; + /** + * 电话 + */ + @Excel(name = "电话", width = 15) + @ApiModelProperty(value = "电话") + private java.lang.String telephone; + /** + * 公户开户行 + */ + @Excel(name = "公户开户行", width = 15) + @ApiModelProperty(value = "公户开户行") + private java.lang.String bankPublic; + /** + * 公户账号 + */ + @Excel(name = "公户账号", width = 15) + @ApiModelProperty(value = "公户账号") + private java.lang.String accountNumber; + /** + * 销售门店 + */ + @Excel(name = "销售门店", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @ApiModelProperty(value = "销售门店") + private java.lang.String salesEnterpriseId; + /** + * 销售员 + */ + @Excel(name = "销售员", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") + @ApiModelProperty(value = "销售员") + private java.lang.String salespersonId; + /** + * 物流企业 + */ + @Excel(name = "物流企业", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @ApiModelProperty(value = "物流企业") + private java.lang.String logisticsEnterprisesId; + /** + * 交付状态 + * 值:未支付0、已支付1、待生产中2、生产中3、已发货4、已到货5、已签收6、申请撤销8、已撤销9,默认0 + */ + @Excel(name = "交付状态", width = 15, dicCode = "delivery_status") + @Dict(dicCode = "delivery_status") + @ApiModelProperty(value = "交付状态") + private java.lang.Integer deliveryStatus; + + /** + * 是否虚拟订单 + */ + @Dict(dicCode = "isvirtual") + @ApiModelProperty(value = "是否虚拟订单") + private java.lang.String isvirtual; +} 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 3b9d3ba3..2601844f 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 @@ -47,4 +47,11 @@ public class ProductionLargeScreenController { return Result.OK(data); } + @ApiOperation(value = "生产大屏-工单&订单(转换关系)", notes = "生产大屏-工单&订单(转换关系)") + @GetMapping("/gongdan_data") + public Result gongdan_data() { + Map data = productionLargeService.gongdan_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 0c85ddfa..13cd6b2d 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 @@ -7,4 +7,7 @@ public interface ProductionLargeService { Map shebeixinxi_data(); Map shengchanxian_data(); + + Map gongdan_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 f20c0055..638c9362 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 @@ -2,9 +2,11 @@ package org.jeecg.modules.largeScreen.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import io.swagger.models.auth.In; +import org.apache.commons.lang3.StringUtils; import org.jeecg.modules.demo.base.entity.ZyProcess; import org.jeecg.modules.demo.base.service.IZyProcessService; +import org.jeecg.modules.demo.zyorders.entity.ZyOrders; +import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; import org.jeecg.modules.device.entity.ZyDevice; import org.jeecg.modules.device.service.IZyDeviceService; import org.jeecg.modules.largeScreen.service.ProductionLargeService; @@ -15,11 +17,16 @@ 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.entity.SysUser; import org.jeecg.modules.system.service.ISysDepartService; +import org.jeecg.modules.system.service.ISysUserService; 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.jeecg.modules.workorder.entity.WorkOrder; +import org.jeecg.modules.workorder.service.IWorkOrderService; +import org.jeecg.modules.workorder.vo.WorkOrderVo; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -27,9 +34,8 @@ 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; +import java.util.stream.Collectors; @Service public class ProductionLargeServiceImpl implements ProductionLargeService { @@ -54,6 +60,15 @@ public class ProductionLargeServiceImpl implements ProductionLargeService { @Autowired private ISysDepartService iSysDepartService; + @Autowired + private IWorkOrderService iWorkOrderService; + + @Autowired + private ISysUserService iSysUserService; + + @Autowired + private IZyOrdersService iZyOrdersService; + // D00010:智能定制生产吊挂系统 private static final String DIAOGUA = "D00010"; @@ -107,7 +122,7 @@ public class ProductionLargeServiceImpl implements ProductionLargeService { //吊挂编码 diaoguaData.put("code", diaogua.getCode()); //负载 - String ratioStr = getRatioStr(productPlanList.size(), diaogua.getVal()); + String ratioStr = getRatioStr(diaogua.getVal(), productPlanList.size()); diaoguaData.put("ratio", ratioStr); resultMap.put("diaogua_", diaoguaData); @@ -118,7 +133,7 @@ public class ProductionLargeServiceImpl implements ProductionLargeService { //吊挂编码 caichuangData.put("code", caichuang.getCode()); //负载 - caichuangData.put("ratio", getRatioStr(productPlanList.size(), caichuang.getVal())); + caichuangData.put("ratio", getRatioStr(caichuang.getVal(), productPlanList.size())); resultMap.put("caichuang_", caichuangData); } @@ -164,6 +179,8 @@ public class ProductionLargeServiceImpl implements ProductionLargeService { List stationGroup = iStationService.list(new LambdaQueryWrapper().groupBy(Station::getDepartId)); Map shengchanxianMap = new LinkedHashMap<>(); +// Map chanxianxinxiMap = new LinkedHashMap<>(); + List chanxianxinxiVos = new LinkedList<>(); if (!ObjectUtils.isEmpty(stationGroup)) { stationGroup.stream().forEach(station -> { Map departMap = new LinkedHashMap<>(); @@ -181,7 +198,6 @@ public class ProductionLargeServiceImpl implements ProductionLargeService { .last("limit 1")); if (!ObjectUtils.isEmpty(zyPlanProcess)) { ZyProductPlan productPlan = iZyProductPlanService.getById(zyPlanProcess.getPlanId()); -// Optional.ofNullable(productPlan).orElseThrow(() -> new JeecgBootException("生产计划:" + zyPlanProcess.getPlanId() + "不存在!")); ProductRecordVo vo = new ProductRecordVo(); if (!ObjectUtils.isEmpty(productPlan)) { vo.setWorkOrder(productPlan.getProductNo()); @@ -193,14 +209,33 @@ public class ProductionLargeServiceImpl implements ProductionLargeService { vo.setMachineNames(zyPlanProcess.getMachineNames()); vo.setStationNum(zyPlanProcess.getStationNum()); vo.setProcessStatus(zyPlanProcess.getStatus()); - ZyPlanProcessVo zyPlanProcessVo = new ZyPlanProcessVo(); - BeanUtils.copyProperties(zyPlanProcess, zyPlanProcessVo); + productRecordVos.add(vo); + + ZyPlanProcessVo chanxianxinxiVo = new ZyPlanProcessVo(); + BeanUtils.copyProperties(vo, chanxianxinxiVo); ZyProcess zyProcess = iZyProcessService.getById(zyPlanProcess.getProcessId()); if (!ObjectUtils.isEmpty(zyProcess)) { - zyPlanProcessVo.setImage(zyProcess.getImage()); + Map stationInfoMap = new LinkedHashMap<>(); + stationInfoMap.put("stationNum", chanxianxinxiVo.getStationNum()); + stationInfoMap.put("workOrder", chanxianxinxiVo.getWorkOrder()); + stationInfoMap.put("processCode", zyProcess.getProcessCode()); + stationInfoMap.put("status", chanxianxinxiVo.getProcessStatus()); + stationInfoMap.put("processImage", zyProcess.getImage()); + chanxianxinxiVo.setStationInfo(stationInfoMap); } - vo.setZyPlanProcessVo(zyPlanProcessVo); - productRecordVos.add(vo); + + if (StringUtils.isNotBlank(zyPlanProcess.getUserIds())) { + String[] userIdsArrs = zyPlanProcess.getUserIds().split(","); + SysUser sysUser = iSysUserService.getById(userIdsArrs[0]); + Map userInfoMap = new LinkedHashMap<>(); + userInfoMap.put("realName", sysUser.getRealname()); + userInfoMap.put("userCode", sysUser.getUsername()); + userInfoMap.put("stationName", chanxianxinxiVo.getStationName()); + userInfoMap.put("status", "工作中"); + chanxianxinxiVo.setUserInfo(userInfoMap); + } + chanxianxinxiVos.add(chanxianxinxiVo); +// vo.setZyPlanProcessVo(zyPlanProcessVo); } else { //没有工序返回工位信息 ProductRecordVo vo = new ProductRecordVo(); vo.setStationName(obj.getStationName()); @@ -209,11 +244,84 @@ public class ProductionLargeServiceImpl implements ProductionLargeService { } }); SysDepart depart = iSysDepartService.getOne(new LambdaQueryWrapper().eq(SysDepart::getId, station.getDepartId())); - departMap.put(depart.getDepartName(), productRecordVos); + List voList = productRecordVos.stream().filter(v -> StringUtils.isNotBlank(v.getTeamName())).collect(Collectors.toList()); + departMap.put(depart.getDepartName() + "#" + voList.get(0).getTeamName(), productRecordVos); shengchanxianMap.putAll(departMap); }); } - resultMap.put("shengchanxian_", shengchanxianMap); + //生产线实时状态 + resultMap.put("shengchanxianzhuangtai_", shengchanxianMap); + //产线实时信息 + resultMap.put("chanxianxinxi_", chanxianxinxiVos); + return resultMap; + } + + @Override + public Map gongdan_data() { + Map resultMap = new HashMap<>(); + List workOrderVoList = new LinkedList<>(); + List zyOrdersVoList = new LinkedList<>(); + List workOrderList = iWorkOrderService.list(new LambdaQueryWrapper().orderByDesc(WorkOrder::getCreateTime).last("limit 20")); + Map workOrderMap = new HashMap<>(); + Optional.ofNullable(workOrderList).orElse(new LinkedList<>()).forEach(workOrder -> { + WorkOrderVo vo = new WorkOrderVo(); + BeanUtils.copyProperties(workOrder, vo); + ZyOrders zyOrders = iZyOrdersService.getById(workOrder.getOrdersId()); + if (!ObjectUtils.isEmpty(zyOrders)) { +// String ordersNum = zyOrders.getOrdersNum(); +// String ordersNum2 = ordersNum.substring(ordersNum.length() - 8); +// zyOrders.setOrdersNum(ordersNum2); +//// vo.setOrdersInfo(zyOrders); +// +// String productCode = vo.getProductCode(); +// String code = productCode.substring(productCode.length() - 8); +// vo.setProductCode(code); + workOrderVoList.add(vo); + SysUser sysUser = iSysUserService.getById(zyOrders.getUserId()); + if (!ObjectUtils.isEmpty(sysUser) && StringUtils.isNotBlank(sysUser.getRealname())) { + zyOrders.setUserId(sysUser.getRealname()); + } + zyOrdersVoList.add(zyOrders); + } + }); + //工单列表 + Collections.sort(workOrderVoList, Comparator.comparing(WorkOrderVo::getOrdersId)); + workOrderMap.put("workOrderList_", workOrderVoList); + //订单列表 + Collections.sort(zyOrdersVoList, Comparator.comparing(ZyOrders::getId)); + workOrderMap.put("zyOrdersList_", zyOrdersVoList); + //统计占率比 + List workOrderList1 = iWorkOrderService.list(); + if (!ObjectUtils.isEmpty(workOrderList1)) { + // 工单状态值:未排产0、已排产1、生产中2、已完成3、已撤销8、异常9,默认0 + //待生产 + List tobeProducedWorkOrders = Optional.ofNullable(workOrderList1).orElse(new LinkedList<>()).stream().filter(b -> !ObjectUtils.isEmpty(b.getWorkOrderStatus()) && b.getWorkOrderStatus().equals(1)).collect(Collectors.toList()); + //已完成 + List doneWorkOrders = Optional.ofNullable(workOrderList1).orElse(new LinkedList<>()).stream().filter(b -> !ObjectUtils.isEmpty(b.getWorkOrderStatus()) && b.getWorkOrderStatus().equals(3)).collect(Collectors.toList()); + if (!ObjectUtils.isEmpty(tobeProducedWorkOrders)) { + resultMap.put("workOrder_tobeDone_ratio_", getRatioStr(tobeProducedWorkOrders.size(), workOrderList1.size())); + } + if (!ObjectUtils.isEmpty(doneWorkOrders)) { + resultMap.put("workOrder_done_ratio_", getRatioStr(doneWorkOrders.size(), workOrderList1.size())); + } + } + + List zyOrdersList = iZyOrdersService.list(); + if (!ObjectUtils.isEmpty(zyOrdersList)) { + // 订单交付状态值:值:未支付0、已支付1、待生产中2、生产中3、已发货4、已到货5、已签收6、申请撤销8、已撤销9,默认0 + //待生产 + List tobeProducedZyOrders = zyOrdersList.stream().filter(b -> !ObjectUtils.isEmpty(b.getDeliveryStatus()) && b.getDeliveryStatus().equals(2)).collect(Collectors.toList()); + if (!ObjectUtils.isEmpty(tobeProducedZyOrders)) { + resultMap.put("zyOrder_tobeDone_ratio_", getRatioStr(tobeProducedZyOrders.size(), zyOrdersList.size())); + } + //已完成 + List doneZyOrders = zyOrdersList.stream().filter(c -> !ObjectUtils.isEmpty(c.getDeliveryStatus()) && c.getDeliveryStatus().equals(5)).collect(Collectors.toList()); + if (!ObjectUtils.isEmpty(doneZyOrders)) { + resultMap.put("zyOrder_done_ratio_", getRatioStr(doneZyOrders.size(), zyOrdersList.size())); + } + } + + resultMap.putAll(workOrderMap); 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 7f1aa8ce..2a887831 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 @@ -58,6 +58,6 @@ public class ProductRecordVo implements Serializable { @ApiModelProperty(value = "工位工序状态") private Integer processStatus; - @ApiModelProperty(value = "工序信息Vo") - private ZyPlanProcessVo zyPlanProcessVo; +// @ApiModelProperty(value = "工序信息Vo") +// private ZyPlanProcessVo zyPlanProcessVo; } 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 bed70015..6361452c 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 @@ -381,6 +381,30 @@ public class ZyPlanProcessController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcess, req.getParameterMap()); queryWrapper.eq("station_id",stationid); + queryWrapper.in("status",1,2); + Page 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); + } + + @ApiOperation(value = "生产计划工序-分页列表查询", notes = "生产计划工序-分页列表查询") + @GetMapping(value = "/pagelist1") + public Result pagelist1(ZyPlanProcess zyPlanProcess, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + //这里方便获取当前登陆信息 + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + String username = loginUser.getUsername(); + String stationid = useridstationid.get(username).toString(); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcess, req.getParameterMap()); + queryWrapper.eq("station_id",stationid); + queryWrapper.eq("status",3); Page page = new Page(pageNo, pageSize); IPage pageList = zyPlanProcessService.page(page, queryWrapper); for(int i = 0 ; i < pageList.getRecords().size() ; i++){ diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ChanXianShiShiXinXiVo.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ChanXianShiShiXinXiVo.java new file mode 100644 index 00000000..bab6d334 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ChanXianShiShiXinXiVo.java @@ -0,0 +1,30 @@ +package org.jeecg.modules.productplan.entity.vo; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecg.modules.team.vo.GroupxMemeberVo; +import org.jeecg.modules.team.vo.StationVo; + +import java.io.Serializable; +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class ChanXianShiShiXinXiVo implements Serializable { + + private static final long serialVersionUID = 1009888L; + + //工单id + private String workOrderId; + +// private String departId; +// private String departName; + + //工位 + private String stationName; + +// private String groupName; + private String processName; +} 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 index 1a548a6c..6a9c69ac 100644 --- 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 @@ -3,12 +3,18 @@ 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; +import org.jeecg.modules.largeScreen.vo.ProductRecordVo; + +import java.util.Map; +import java.util.Objects; @Data -@ApiModel(value="ZyPlanProcessVo", description="ZyPlanProcessVo") -public class ZyPlanProcessVo extends ZyPlanProcess { +@ApiModel(value = "ZyPlanProcessVo", description = "ZyPlanProcessVo") +public class ZyPlanProcessVo extends ProductRecordVo { + + @ApiModelProperty(value = "工位信息") + private Map stationInfo; - @ApiModelProperty(value = "工序图片") - private String image; + @ApiModelProperty(value = "工人信息") + private Map userInfo; } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/IZyProductPlanAutoServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/IZyProductPlanAutoServiceImpl.java index a0e29caf..0aa70765 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/IZyProductPlanAutoServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/IZyProductPlanAutoServiceImpl.java @@ -338,6 +338,7 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl { @Autowired private IZyProductService zyProductService; - + /** * 分页列表查询 * @@ -72,7 +72,7 @@ public class ZyProductController extends JeecgController pageList = zyProductService.selectListPage(page, zyProduct); return Result.OK(pageList); } - + /** * 添加 * @@ -86,7 +86,7 @@ public class ZyProductController extends JeecgController queryByProductCode(@RequestParam(name="productCode",required=true) String productCode,HttpServletRequest req) { + ZyProduct zyProduct = new ZyProduct(); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyProduct, req.getParameterMap()); + queryWrapper.eq("product_code",productCode); + zyProduct = zyProductService.list(queryWrapper).get(0); + if(zyProduct==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(zyProduct); + } + /** * 导出excel *