生产大屏数据统计 6.9

master
zhc077 1 year ago
parent a7f0dac52e
commit c2dc70d5a1
  1. 162
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrders.java
  2. 7
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/controller/ProductionLargeScreenController.java
  3. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/ProductionLargeService.java
  4. 134
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/impl/ProductionLargeServiceImpl.java
  5. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/vo/ProductRecordVo.java
  6. 30
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ChanXianShiShiXinXiVo.java
  7. 14
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ZyPlanProcessVo.java
  8. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/IZyProductPlanAutoServiceImpl.java
  9. 16
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/vo/WorkOrderVo.java

@ -4,6 +4,7 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.Date; import java.util.Date;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
@ -31,180 +32,261 @@ import lombok.experimental.Accessors;
public class ZyOrders implements Serializable { public class ZyOrders implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**主键*/ /**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "主键")
private java.lang.String id; private java.lang.String id;
/**创建人*/ /**
* 创建人
*/
@ApiModelProperty(value = "创建人") @ApiModelProperty(value = "创建人")
private java.lang.String createBy; private java.lang.String createBy;
/**创建日期*/ /**
* 创建日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "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") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期") @ApiModelProperty(value = "创建日期")
private java.util.Date createTime; private java.util.Date createTime;
/**更新人*/ /**
* 更新人
*/
@ApiModelProperty(value = "更新人") @ApiModelProperty(value = "更新人")
private java.lang.String updateBy; private java.lang.String updateBy;
/**更新日期*/ /**
* 更新日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "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") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期") @ApiModelProperty(value = "更新日期")
private java.util.Date updateTime; private java.util.Date updateTime;
/**所属部门*/ /**
* 所属部门
*/
@ApiModelProperty(value = "所属部门") @ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode; private java.lang.String sysOrgCode;
/**是否子单*/ /**
* 是否子单
*/
@Excel(name = "是否子单", width = 15, dicCode = "ischild") @Excel(name = "是否子单", width = 15, dicCode = "ischild")
@Dict(dicCode = "ischild") @Dict(dicCode = "ischild")
@ApiModelProperty(value = "是否子单") @ApiModelProperty(value = "是否子单")
private java.lang.Integer ischild; private java.lang.Integer ischild;
/**原订单id*/ /**
* 原订单id
*/
@Excel(name = "原订单id", width = 15) @Excel(name = "原订单id", width = 15)
@Dict(dictTable = "zy_orders", dicText = "orders_num", dicCode = "id") @Dict(dictTable = "zy_orders", dicText = "orders_num", dicCode = "id")
@ApiModelProperty(value = "原订单id") @ApiModelProperty(value = "原订单id")
private java.lang.String orderId; private java.lang.String orderId;
/**下单时间*/ /**
* 下单时间
*/
@Excel(name = "下单时间", width = 15, format = "yyyy-MM-dd HH:mm:ss") @Excel(name = "下单时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "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") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "下单时间") @ApiModelProperty(value = "下单时间")
private java.util.Date orderTime; private java.util.Date orderTime;
/**订单编号*/ /**
* 订单编号
*/
@Excel(name = "订单编号", width = 15) @Excel(name = "订单编号", width = 15)
@ApiModelProperty(value = "订单编号") @ApiModelProperty(value = "订单编号")
private java.lang.String ordersNum; private java.lang.String ordersNum;
/**总金额*/ /**
* 总金额
*/
@Excel(name = "总金额", width = 15) @Excel(name = "总金额", width = 15)
@ApiModelProperty(value = "总金额") @ApiModelProperty(value = "总金额")
private java.lang.Double money; private java.lang.Double money;
/**运费*/ /**
* 运费
*/
@Excel(name = "运费", width = 15) @Excel(name = "运费", width = 15)
@ApiModelProperty(value = "运费") @ApiModelProperty(value = "运费")
private java.lang.Double freight; private java.lang.Double freight;
/**促销*/ /**
* 促销
*/
@Excel(name = "促销", width = 15) @Excel(name = "促销", width = 15)
@ApiModelProperty(value = "促销") @ApiModelProperty(value = "促销")
private java.lang.Double promotionPrice; private java.lang.Double promotionPrice;
/**实付款*/ /**
* 实付款
*/
@Excel(name = "实付款", width = 15) @Excel(name = "实付款", width = 15)
@ApiModelProperty(value = "实付款") @ApiModelProperty(value = "实付款")
private java.lang.Double actualPayment; private java.lang.Double actualPayment;
/**交货期*/ /**
* 交货期
*/
@Excel(name = "交货期", width = 15) @Excel(name = "交货期", width = 15)
@ApiModelProperty(value = "交货期") @ApiModelProperty(value = "交货期")
private java.lang.Integer deliveryTime; private java.lang.Integer deliveryTime;
/**订单类型*/ /**
* 订单类型
*/
@Excel(name = "订单类型", width = 15, dicCode = "orders_type") @Excel(name = "订单类型", width = 15, dicCode = "orders_type")
@Dict(dicCode = "orders_type") @Dict(dicCode = "orders_type")
@ApiModelProperty(value = "订单类型") @ApiModelProperty(value = "订单类型")
private java.lang.Integer ordersType; private java.lang.Integer ordersType;
/**顾客id*/ /**
* 顾客id
*/
@Excel(name = "顾客id", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") @Excel(name = "顾客id", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id") @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
@ApiModelProperty(value = "顾客id") @ApiModelProperty(value = "顾客id")
private java.lang.String userId; private java.lang.String userId;
/**商品条目数量*/ /**
* 商品条目数量
*/
@Excel(name = "商品条目数量", width = 15) @Excel(name = "商品条目数量", width = 15)
@ApiModelProperty(value = "商品条目数量") @ApiModelProperty(value = "商品条目数量")
private java.lang.Integer goodsQuantity; private java.lang.Integer goodsQuantity;
/**支付方式*/ /**
* 支付方式
*/
@Excel(name = "支付方式", width = 15, dicCode = "payment_method") @Excel(name = "支付方式", width = 15, dicCode = "payment_method")
@Dict(dicCode = "payment_method") @Dict(dicCode = "payment_method")
@ApiModelProperty(value = "支付方式") @ApiModelProperty(value = "支付方式")
private java.lang.Integer paymentMethod; private java.lang.Integer paymentMethod;
/**支付状态*/ /**
* 支付状态
*/
@Excel(name = "支付状态", width = 15, dicCode = "payment_status") @Excel(name = "支付状态", width = 15, dicCode = "payment_status")
@Dict(dicCode = "payment_status") @Dict(dicCode = "payment_status")
@ApiModelProperty(value = "支付状态") @ApiModelProperty(value = "支付状态")
private java.lang.Integer paymentStatus; private java.lang.Integer paymentStatus;
/**账号/卡号*/ /**
* 账号/卡号
*/
@Excel(name = "账号/卡号", width = 15) @Excel(name = "账号/卡号", width = 15)
@ApiModelProperty(value = "账号/卡号") @ApiModelProperty(value = "账号/卡号")
private java.lang.String accountNo; private java.lang.String accountNo;
/**开户银行*/ /**
* 开户银行
*/
@Excel(name = "开户银行", width = 15) @Excel(name = "开户银行", width = 15)
@ApiModelProperty(value = "开户银行") @ApiModelProperty(value = "开户银行")
private java.lang.String bankDeposit; private java.lang.String bankDeposit;
/**支付时间*/ /**
* 支付时间
*/
@Excel(name = "支付时间", width = 15, format = "yyyy-MM-dd hh:mm:ss") @Excel(name = "支付时间", width = 15, format = "yyyy-MM-dd hh:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "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") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "支付时间") @ApiModelProperty(value = "支付时间")
private java.util.Date paymentTime; private java.util.Date paymentTime;
/**城市*/ /**
* 城市
*/
@Excel(name = "城市", width = 15) @Excel(name = "城市", width = 15)
@ApiModelProperty(value = "城市") @ApiModelProperty(value = "城市")
private java.lang.String cityId; private java.lang.String cityId;
/**地址*/ /**
* 地址
*/
@Excel(name = "地址", width = 15) @Excel(name = "地址", width = 15)
@ApiModelProperty(value = "地址") @ApiModelProperty(value = "地址")
private java.lang.String address; private java.lang.String address;
/**邮编*/ /**
* 邮编
*/
@Excel(name = "邮编", width = 15) @Excel(name = "邮编", width = 15)
@ApiModelProperty(value = "邮编") @ApiModelProperty(value = "邮编")
private java.lang.String zipCode; private java.lang.String zipCode;
/**收货人*/ /**
* 收货人
*/
@Excel(name = "收货人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") @Excel(name = "收货人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
@ApiModelProperty(value = "收货人") @ApiModelProperty(value = "收货人")
private java.lang.String receiver; private java.lang.String receiver;
/**联系电话*/ /**
* 联系电话
*/
@Excel(name = "联系电话", width = 15) @Excel(name = "联系电话", width = 15)
@ApiModelProperty(value = "联系电话") @ApiModelProperty(value = "联系电话")
private java.lang.String mobile; private java.lang.String mobile;
/**发票客户类型*/ /**
* 发票客户类型
*/
@Excel(name = "发票客户类型", width = 15, dicCode = "invoice_customer_type") @Excel(name = "发票客户类型", width = 15, dicCode = "invoice_customer_type")
@Dict(dicCode = "invoice_customer_type") @Dict(dicCode = "invoice_customer_type")
@ApiModelProperty(value = "发票客户类型") @ApiModelProperty(value = "发票客户类型")
private java.lang.Integer invoiceCustomerType; private java.lang.Integer invoiceCustomerType;
/**发票类型*/ /**
* 发票类型
*/
@Excel(name = "发票类型", width = 15, dicCode = "invoice_type") @Excel(name = "发票类型", width = 15, dicCode = "invoice_type")
@Dict(dicCode = "invoice_type") @Dict(dicCode = "invoice_type")
@ApiModelProperty(value = "发票类型") @ApiModelProperty(value = "发票类型")
private java.lang.Integer invoiceType; private java.lang.Integer invoiceType;
/**纳税人识别号*/ /**
* 纳税人识别号
*/
@Excel(name = "纳税人识别号", width = 15) @Excel(name = "纳税人识别号", width = 15)
@ApiModelProperty(value = "纳税人识别号") @ApiModelProperty(value = "纳税人识别号")
private java.lang.String taxIdentificationNumber; private java.lang.String taxIdentificationNumber;
/**开票地址*/ /**
* 开票地址
*/
@Excel(name = "开票地址", width = 15) @Excel(name = "开票地址", width = 15)
@ApiModelProperty(value = "开票地址") @ApiModelProperty(value = "开票地址")
private java.lang.String addressBilling; private java.lang.String addressBilling;
/**电话*/ /**
* 电话
*/
@Excel(name = "电话", width = 15) @Excel(name = "电话", width = 15)
@ApiModelProperty(value = "电话") @ApiModelProperty(value = "电话")
private java.lang.String telephone; private java.lang.String telephone;
/**公户开户行*/ /**
* 公户开户行
*/
@Excel(name = "公户开户行", width = 15) @Excel(name = "公户开户行", width = 15)
@ApiModelProperty(value = "公户开户行") @ApiModelProperty(value = "公户开户行")
private java.lang.String bankPublic; private java.lang.String bankPublic;
/**公户账号*/ /**
* 公户账号
*/
@Excel(name = "公户账号", width = 15) @Excel(name = "公户账号", width = 15)
@ApiModelProperty(value = "公户账号") @ApiModelProperty(value = "公户账号")
private java.lang.String accountNumber; private java.lang.String accountNumber;
/**销售门店*/ /**
* 销售门店
*/
@Excel(name = "销售门店", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") @Excel(name = "销售门店", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@ApiModelProperty(value = "销售门店") @ApiModelProperty(value = "销售门店")
private java.lang.String salesEnterpriseId; private java.lang.String salesEnterpriseId;
/**销售员*/ /**
* 销售员
*/
@Excel(name = "销售员", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") @Excel(name = "销售员", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
@ApiModelProperty(value = "销售员") @ApiModelProperty(value = "销售员")
private java.lang.String salespersonId; private java.lang.String salespersonId;
/**物流企业*/ /**
* 物流企业
*/
@Excel(name = "物流企业", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") @Excel(name = "物流企业", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@ApiModelProperty(value = "物流企业") @ApiModelProperty(value = "物流企业")
private java.lang.String logisticsEnterprisesId; private java.lang.String logisticsEnterprisesId;
/**交付状态*/ /**
* 交付状态
* 未支付0已支付1待生产中2生产中3已发货4已到货5已签收6申请撤销8已撤销9默认0
*/
@Excel(name = "交付状态", width = 15, dicCode = "delivery_status") @Excel(name = "交付状态", width = 15, dicCode = "delivery_status")
@Dict(dicCode = "delivery_status") @Dict(dicCode = "delivery_status")
@ApiModelProperty(value = "交付状态") @ApiModelProperty(value = "交付状态")
private java.lang.Integer deliveryStatus; private java.lang.Integer deliveryStatus;
/**是否虚拟订单*/ /**
* 是否虚拟订单
*/
@Dict(dicCode = "isvirtual") @Dict(dicCode = "isvirtual")
@ApiModelProperty(value = "是否虚拟订单") @ApiModelProperty(value = "是否虚拟订单")
private java.lang.String isvirtual; private java.lang.String isvirtual;

@ -47,4 +47,11 @@ public class ProductionLargeScreenController {
return Result.OK(data); return Result.OK(data);
} }
@ApiOperation(value = "生产大屏-工单&订单(转换关系)", notes = "生产大屏-工单&订单(转换关系)")
@GetMapping("/gongdan_data")
public Result<?> gongdan_data() {
Map<String, Object> data = productionLargeService.gongdan_data();
return Result.OK(data);
}
} }

@ -7,4 +7,7 @@ public interface ProductionLargeService {
Map<String, Object> shebeixinxi_data(); Map<String, Object> shebeixinxi_data();
Map<String, Object> shengchanxian_data(); Map<String, Object> shengchanxian_data();
Map<String, Object> gongdan_data();
} }

@ -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.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.entity.ZyProcess;
import org.jeecg.modules.demo.base.service.IZyProcessService; 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.entity.ZyDevice;
import org.jeecg.modules.device.service.IZyDeviceService; import org.jeecg.modules.device.service.IZyDeviceService;
import org.jeecg.modules.largeScreen.service.ProductionLargeService; 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.IZyPlanProcessService;
import org.jeecg.modules.productplan.service.IZyProductPlanService; import org.jeecg.modules.productplan.service.IZyProductPlanService;
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.team.entity.Groupx; import org.jeecg.modules.team.entity.Groupx;
import org.jeecg.modules.team.entity.Station; import org.jeecg.modules.team.entity.Station;
import org.jeecg.modules.team.service.IGroupxService; import org.jeecg.modules.team.service.IGroupxService;
import org.jeecg.modules.team.service.IStationService; 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.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -27,9 +34,8 @@ import org.springframework.util.ObjectUtils;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors;
@Service @Service
public class ProductionLargeServiceImpl implements ProductionLargeService { public class ProductionLargeServiceImpl implements ProductionLargeService {
@ -54,6 +60,15 @@ public class ProductionLargeServiceImpl implements ProductionLargeService {
@Autowired @Autowired
private ISysDepartService iSysDepartService; private ISysDepartService iSysDepartService;
@Autowired
private IWorkOrderService iWorkOrderService;
@Autowired
private ISysUserService iSysUserService;
@Autowired
private IZyOrdersService iZyOrdersService;
// D00010:智能定制生产吊挂系统 // D00010:智能定制生产吊挂系统
private static final String DIAOGUA = "D00010"; private static final String DIAOGUA = "D00010";
@ -107,7 +122,7 @@ public class ProductionLargeServiceImpl implements ProductionLargeService {
//吊挂编码 //吊挂编码
diaoguaData.put("code", diaogua.getCode()); diaoguaData.put("code", diaogua.getCode());
//负载 //负载
String ratioStr = getRatioStr(productPlanList.size(), diaogua.getVal()); String ratioStr = getRatioStr(diaogua.getVal(), productPlanList.size());
diaoguaData.put("ratio", ratioStr); diaoguaData.put("ratio", ratioStr);
resultMap.put("diaogua_", diaoguaData); resultMap.put("diaogua_", diaoguaData);
@ -118,7 +133,7 @@ public class ProductionLargeServiceImpl implements ProductionLargeService {
//吊挂编码 //吊挂编码
caichuangData.put("code", caichuang.getCode()); 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); resultMap.put("caichuang_", caichuangData);
} }
@ -164,6 +179,8 @@ public class ProductionLargeServiceImpl implements ProductionLargeService {
List<Station> stationGroup = iStationService.list(new LambdaQueryWrapper<Station>().groupBy(Station::getDepartId)); List<Station> stationGroup = iStationService.list(new LambdaQueryWrapper<Station>().groupBy(Station::getDepartId));
Map<String, Object> shengchanxianMap = new LinkedHashMap<>(); Map<String, Object> shengchanxianMap = new LinkedHashMap<>();
// Map<String, Object> chanxianxinxiMap = new LinkedHashMap<>();
List<ProductRecordVo> chanxianxinxiVos = new LinkedList<>();
if (!ObjectUtils.isEmpty(stationGroup)) { if (!ObjectUtils.isEmpty(stationGroup)) {
stationGroup.stream().forEach(station -> { stationGroup.stream().forEach(station -> {
Map<String, Object> departMap = new LinkedHashMap<>(); Map<String, Object> departMap = new LinkedHashMap<>();
@ -181,7 +198,6 @@ public class ProductionLargeServiceImpl implements ProductionLargeService {
.last("limit 1")); .last("limit 1"));
if (!ObjectUtils.isEmpty(zyPlanProcess)) { if (!ObjectUtils.isEmpty(zyPlanProcess)) {
ZyProductPlan productPlan = iZyProductPlanService.getById(zyPlanProcess.getPlanId()); ZyProductPlan productPlan = iZyProductPlanService.getById(zyPlanProcess.getPlanId());
// Optional.ofNullable(productPlan).orElseThrow(() -> new JeecgBootException("生产计划:" + zyPlanProcess.getPlanId() + "不存在!"));
ProductRecordVo vo = new ProductRecordVo(); ProductRecordVo vo = new ProductRecordVo();
if (!ObjectUtils.isEmpty(productPlan)) { if (!ObjectUtils.isEmpty(productPlan)) {
vo.setWorkOrder(productPlan.getProductNo()); vo.setWorkOrder(productPlan.getProductNo());
@ -193,14 +209,33 @@ public class ProductionLargeServiceImpl implements ProductionLargeService {
vo.setMachineNames(zyPlanProcess.getMachineNames()); vo.setMachineNames(zyPlanProcess.getMachineNames());
vo.setStationNum(zyPlanProcess.getStationNum()); vo.setStationNum(zyPlanProcess.getStationNum());
vo.setProcessStatus(zyPlanProcess.getStatus()); vo.setProcessStatus(zyPlanProcess.getStatus());
ZyPlanProcessVo zyPlanProcessVo = new ZyPlanProcessVo(); productRecordVos.add(vo);
BeanUtils.copyProperties(zyPlanProcess, zyPlanProcessVo);
ZyPlanProcessVo chanxianxinxiVo = new ZyPlanProcessVo();
BeanUtils.copyProperties(vo, chanxianxinxiVo);
ZyProcess zyProcess = iZyProcessService.getById(zyPlanProcess.getProcessId()); ZyProcess zyProcess = iZyProcessService.getById(zyPlanProcess.getProcessId());
if (!ObjectUtils.isEmpty(zyProcess)) { if (!ObjectUtils.isEmpty(zyProcess)) {
zyPlanProcessVo.setImage(zyProcess.getImage()); Map<String, Object> 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<String, Object> 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 { //没有工序返回工位信息 } else { //没有工序返回工位信息
ProductRecordVo vo = new ProductRecordVo(); ProductRecordVo vo = new ProductRecordVo();
vo.setStationName(obj.getStationName()); vo.setStationName(obj.getStationName());
@ -209,11 +244,84 @@ public class ProductionLargeServiceImpl implements ProductionLargeService {
} }
}); });
SysDepart depart = iSysDepartService.getOne(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getId, station.getDepartId())); SysDepart depart = iSysDepartService.getOne(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getId, station.getDepartId()));
departMap.put(depart.getDepartName(), productRecordVos); List<ProductRecordVo> voList = productRecordVos.stream().filter(v -> StringUtils.isNotBlank(v.getTeamName())).collect(Collectors.toList());
departMap.put(depart.getDepartName() + "#" + voList.get(0).getTeamName(), productRecordVos);
shengchanxianMap.putAll(departMap); shengchanxianMap.putAll(departMap);
}); });
} }
resultMap.put("shengchanxian_", shengchanxianMap); //生产线实时状态
resultMap.put("shengchanxianzhuangtai_", shengchanxianMap);
//产线实时信息
resultMap.put("chanxianxinxi_", chanxianxinxiVos);
return resultMap;
}
@Override
public Map<String, Object> gongdan_data() {
Map<String, Object> resultMap = new HashMap<>();
List<WorkOrderVo> workOrderVoList = new LinkedList<>();
List<ZyOrders> zyOrdersVoList = new LinkedList<>();
List<WorkOrder> workOrderList = iWorkOrderService.list(new LambdaQueryWrapper<WorkOrder>().orderByDesc(WorkOrder::getCreateTime).last("limit 20"));
Map<String, Object> 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<WorkOrder> workOrderList1 = iWorkOrderService.list();
if (!ObjectUtils.isEmpty(workOrderList1)) {
// 工单状态值:未排产0、已排产1、生产中2、已完成3、已撤销8、异常9,默认0
//待生产
List<WorkOrder> tobeProducedWorkOrders = Optional.ofNullable(workOrderList1).orElse(new LinkedList<>()).stream().filter(b -> !ObjectUtils.isEmpty(b.getWorkOrderStatus()) && b.getWorkOrderStatus().equals(1)).collect(Collectors.toList());
//已完成
List<WorkOrder> 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<ZyOrders> zyOrdersList = iZyOrdersService.list();
if (!ObjectUtils.isEmpty(zyOrdersList)) {
// 订单交付状态值:值:未支付0、已支付1、待生产中2、生产中3、已发货4、已到货5、已签收6、申请撤销8、已撤销9,默认0
//待生产
List<ZyOrders> 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<ZyOrders> 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; return resultMap;
} }
} }

@ -58,6 +58,6 @@ public class ProductRecordVo implements Serializable {
@ApiModelProperty(value = "工位工序状态") @ApiModelProperty(value = "工位工序状态")
private Integer processStatus; private Integer processStatus;
@ApiModelProperty(value = "工序信息Vo") // @ApiModelProperty(value = "工序信息Vo")
private ZyPlanProcessVo zyPlanProcessVo; // private ZyPlanProcessVo zyPlanProcessVo;
} }

@ -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;
}

@ -3,12 +3,18 @@ package org.jeecg.modules.productplan.entity.vo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; 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 @Data
@ApiModel(value = "ZyPlanProcessVo", description = "ZyPlanProcessVo") @ApiModel(value = "ZyPlanProcessVo", description = "ZyPlanProcessVo")
public class ZyPlanProcessVo extends ZyPlanProcess { public class ZyPlanProcessVo extends ProductRecordVo {
@ApiModelProperty(value = "工位信息")
private Map<String, Object> stationInfo;
@ApiModelProperty(value = "工序图片") @ApiModelProperty(value = "工人信息")
private String image; private Map<String,Object> userInfo;
} }

@ -338,6 +338,7 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp
String code = productCode.substring(productCode.length() - 6); String code = productCode.substring(productCode.length() - 6);
String mess = "工单尾号" + code + ",生产计划已完成制定,请跟进后续生产作业."; String mess = "工单尾号" + code + ",生产计划已完成制定,请跟进后续生产作业.";
zySpeechMessage.setMessage(mess); zySpeechMessage.setMessage(mess);
zySpeechMessage.setMessageType(2);
zySpeechMessage.setWorkorderId(productCode); zySpeechMessage.setWorkorderId(productCode);
iZySpeechMessageService.save(zySpeechMessage); iZySpeechMessageService.save(zySpeechMessage);
} }

@ -0,0 +1,16 @@
package org.jeecg.modules.workorder.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import org.jeecg.modules.workorder.entity.WorkOrder;
@Data
@ApiModel(value = "WorkOrderVo", description = "WorkOrderVo")
public class WorkOrderVo extends WorkOrder {
@ApiModelProperty(value = "订单信息")
private ZyOrders ordersInfo;
}
Loading…
Cancel
Save