增加lms大屏接口:生产统计,仓储监控。
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
package org.nl.wms.cockpit.rest;
|
||||
|
||||
import org.nl.wms.cockpit.service.CockpitService;
|
||||
import org.nl.wms.cockpit.service.dto.WorkorderDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 大屏数据/1
|
||||
*
|
||||
* @author gbx
|
||||
* @since 2023/2/27
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "大屏数据")
|
||||
@RequestMapping("/api/cockpit")
|
||||
@Slf4j
|
||||
public class CockpitController{
|
||||
private final CockpitService cockpitService;
|
||||
|
||||
/**
|
||||
* 生产统计
|
||||
*/
|
||||
@GetMapping("/productionStatistics")
|
||||
@Log("生产统计")
|
||||
@ApiOperation("生产统计")
|
||||
public ResponseEntity<Object> productionStatistics() {
|
||||
return new ResponseEntity<>(cockpitService.productionStatistics(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 仓储监控
|
||||
*/
|
||||
@GetMapping("/storageMonitor")
|
||||
@Log("仓储监控")
|
||||
@ApiOperation("仓储监控")
|
||||
public ResponseEntity<Object> storageMonitor() {
|
||||
return new ResponseEntity<>(cockpitService.storageMonitor(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备监控
|
||||
*/
|
||||
@GetMapping("/deviceMonitor")
|
||||
@Log("设备监控")
|
||||
@ApiOperation("设备监控")
|
||||
public ResponseEntity<Object> deviceMonitor() {
|
||||
return new ResponseEntity<>(cockpitService.deviceMonitor(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 车间情况
|
||||
*/
|
||||
@GetMapping("/workshopCondition")
|
||||
@Log("车间情况")
|
||||
@ApiOperation("车间情况")
|
||||
public ResponseEntity<Object> workshopCondition() {
|
||||
return new ResponseEntity<>(cockpitService.workshopCondition(), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.nl.wms.cockpit.service;
|
||||
|
||||
import org.nl.wms.cockpit.service.dto.WorkorderDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* 大屏服务接口/1
|
||||
*
|
||||
* @author gbx
|
||||
* @date 2023-02-27
|
||||
**/
|
||||
public interface CockpitService{
|
||||
/**
|
||||
* 生产统计
|
||||
*/
|
||||
ConcurrentHashMap<String,Object> productionStatistics();
|
||||
|
||||
/**
|
||||
* 仓储监控
|
||||
*/
|
||||
ConcurrentHashMap<String,Object> storageMonitor();
|
||||
|
||||
/**
|
||||
* 设备监控
|
||||
*/
|
||||
ConcurrentHashMap<String,Object> deviceMonitor();
|
||||
|
||||
/**
|
||||
* 车间情况
|
||||
*/
|
||||
ConcurrentHashMap<String,Object> workshopCondition();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package org.nl.wms.cockpit.service.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author gbx
|
||||
* @description /1
|
||||
* @since 2023/2/27
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProductionStatisticsDto
|
||||
{
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "/**工序*/")
|
||||
/** 工序 */
|
||||
private BigDecimal workorderProcedure;
|
||||
|
||||
@ApiModelProperty(value = "/**计划数量*/")
|
||||
/** 计划数量 */
|
||||
private BigDecimal planQty;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "/**实际数量*/")
|
||||
/** 实际数量 */
|
||||
private BigDecimal realQty;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,207 @@
|
||||
package org.nl.wms.cockpit.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
/**
|
||||
* @author gbx
|
||||
* @description /1
|
||||
* @since 2023/2/27
|
||||
*/
|
||||
@Data
|
||||
public class SchBasePointDto implements Serializable{
|
||||
/**
|
||||
* 点位标识
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long point_id;
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
private String point_code;
|
||||
/**
|
||||
* 物料号
|
||||
*/
|
||||
private String material_code;
|
||||
/**
|
||||
* 生产物料
|
||||
*/
|
||||
private String material_name;
|
||||
/**
|
||||
* 点位名称
|
||||
*/
|
||||
private String point_name;
|
||||
/**
|
||||
* 所属区域
|
||||
*/
|
||||
private Long region_id;
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
private String region_code;
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
private String region_name;
|
||||
/**
|
||||
* 点位类型
|
||||
*/
|
||||
private String point_type;
|
||||
/**
|
||||
* 点位状态
|
||||
*/
|
||||
private String point_status;
|
||||
/**
|
||||
* 锁定类型
|
||||
*/
|
||||
private String lock_type;
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String device_code;
|
||||
/**
|
||||
* MES设备编码
|
||||
*/
|
||||
private String mes_device_code;
|
||||
/**
|
||||
* 允许的载具类型
|
||||
*/
|
||||
private String can_vehicle_type;
|
||||
/**
|
||||
* 载具类型
|
||||
*/
|
||||
private String vehicle_type;
|
||||
/**
|
||||
* 载具编码
|
||||
*/
|
||||
private String vehicle_code;
|
||||
/**
|
||||
* 载具数量
|
||||
*/
|
||||
private BigDecimal vehicle_qty;
|
||||
/**
|
||||
* 块
|
||||
*/
|
||||
private BigDecimal block_num;
|
||||
/**
|
||||
* 排
|
||||
*/
|
||||
private BigDecimal row_num;
|
||||
/**
|
||||
* 列
|
||||
*/
|
||||
private BigDecimal col_num;
|
||||
/**
|
||||
* 层
|
||||
*/
|
||||
private BigDecimal layer_num;
|
||||
/**
|
||||
* 点位组编码
|
||||
*/
|
||||
private String point_group_code;
|
||||
/**
|
||||
* 是否建工单
|
||||
*/
|
||||
private String is_have_workder;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 来源标识
|
||||
*/
|
||||
private Long source_id;
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String is_used;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long create_id;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_name;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long update_optid;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_optname;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
/**
|
||||
* 载具允许最大数量
|
||||
*/
|
||||
private BigDecimal vehicle_max_qty;
|
||||
/**
|
||||
* 入库顺序
|
||||
*/
|
||||
private BigDecimal in_order_seq;
|
||||
/**
|
||||
* 出库顺序
|
||||
*/
|
||||
private BigDecimal out_order_seq;
|
||||
/**
|
||||
* 入空载具顺序
|
||||
*/
|
||||
private BigDecimal in_empty_seq;
|
||||
/**
|
||||
* 出空载具顺序
|
||||
*/
|
||||
private BigDecimal out_empty_seq;
|
||||
/**
|
||||
* 在执行的任务标识
|
||||
*/
|
||||
private Long task_id;
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private Long material_id;
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
/**
|
||||
* 库存数
|
||||
*/
|
||||
private BigDecimal ivt_qty;
|
||||
/**
|
||||
* 计量单位标识
|
||||
*/
|
||||
private Long qty_unit_id;
|
||||
/**
|
||||
* 入库时间
|
||||
*/
|
||||
private String instorage_time;
|
||||
/**
|
||||
* 静置时间(分钟)
|
||||
*/
|
||||
private BigDecimal standing_time;
|
||||
/**
|
||||
* 静置状态
|
||||
*/
|
||||
private String standing_status;
|
||||
/**
|
||||
* 是否关联库存表
|
||||
*/
|
||||
private String is_ref_ivt;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
package org.nl.wms.cockpit.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
/**
|
||||
* @author gbx
|
||||
* @description /1
|
||||
* @date 2023-02-27
|
||||
**/
|
||||
@Data
|
||||
public class WorkorderDto implements Serializable{
|
||||
/**
|
||||
*工单标识
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long workorder_id;
|
||||
/**
|
||||
* 工序
|
||||
*/
|
||||
private String label;
|
||||
/**
|
||||
* 设备
|
||||
*/
|
||||
private String device_name;
|
||||
/**
|
||||
* 物料号
|
||||
*/
|
||||
private String material_code;
|
||||
/**
|
||||
* 生产物料
|
||||
*/
|
||||
private String material_name;
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
private String produce_date;
|
||||
/**
|
||||
* 计划数量
|
||||
*/
|
||||
private BigDecimal plan_qty;
|
||||
/**
|
||||
* 实际数量
|
||||
*/
|
||||
private BigDecimal real_qty;
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private Long material_id;
|
||||
/**
|
||||
* 载具类型
|
||||
*/
|
||||
private String vehicle_type;
|
||||
/**
|
||||
* 计划生产开始时间
|
||||
*/
|
||||
private String planproducestart_date;
|
||||
/**
|
||||
* 计划生产结束时间
|
||||
*/
|
||||
private String planproduceend_date;
|
||||
/**
|
||||
* 实际生产开始时间
|
||||
*/
|
||||
private String realproducestart_date;
|
||||
/**
|
||||
* 实际生产结束时间
|
||||
*/
|
||||
private String realproduceend_date;
|
||||
/**
|
||||
* 设备标识
|
||||
*/
|
||||
private Long device_id;
|
||||
/**
|
||||
* 所属工序:1-压制2-干燥3-成品
|
||||
*/
|
||||
private String workorder_procedure;
|
||||
/**
|
||||
* 工单状态
|
||||
*/
|
||||
private String order_status;
|
||||
/**
|
||||
* 是否搬运
|
||||
*/
|
||||
private String is_needmove;
|
||||
/**
|
||||
* 回传MES状态
|
||||
*/
|
||||
private String passback_status;
|
||||
/**
|
||||
* 外部标识
|
||||
*/
|
||||
private String ext_id;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long create_id;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_name;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long update_optid;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_optname;
|
||||
/**
|
||||
* 工单编号
|
||||
*/
|
||||
private String workorder_code;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
package org.nl.wms.cockpit.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.var;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.nl.config.thread.ThreadPoolExecutorUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.wms.cockpit.service.CockpitService;
|
||||
import org.nl.wms.cockpit.service.dto.ProductionStatisticsDto;
|
||||
import org.nl.wms.cockpit.service.dto.SchBasePointDto;
|
||||
import org.nl.wms.cockpit.service.dto.WorkorderDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.core.bean.ResultBean;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
/**
|
||||
* 大屏服务实现
|
||||
*
|
||||
* @author gbx
|
||||
* @date 2023-02-27
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class CockpitServiceImpl implements CockpitService{
|
||||
/**
|
||||
* 生产统计大屏信息
|
||||
*
|
||||
* @author gbx
|
||||
* @since 2023/2/27
|
||||
*/
|
||||
@Override
|
||||
public ConcurrentHashMap<String,Object> productionStatistics() {
|
||||
ThreadPoolExecutor pool = ThreadPoolExecutorUtil.getPoll();
|
||||
ConcurrentHashMap<String,Object> map = new ConcurrentHashMap<>();
|
||||
// 1、获取生产任务列表
|
||||
CompletableFuture<List<WorkorderDto>> productionTask = CompletableFuture.supplyAsync(() -> {
|
||||
List<WorkorderDto> res = new CopyOnWriteArrayList<>();
|
||||
JSONArray result = WQL.getWO("COCKPIT_PRODUCTION").addParam("flag", "1").process().getResultJSONArray(0);
|
||||
if(ObjectUtil.isNotEmpty(result)) {
|
||||
res = result.toJavaList(WorkorderDto.class);
|
||||
}
|
||||
return res;
|
||||
}, pool);
|
||||
productionTask.thenAccept((result) -> {
|
||||
map.put("productionTask", result);
|
||||
}).exceptionally((e) -> {
|
||||
log.error("获取生产任务列表: {}", e.getMessage(), e);
|
||||
map.put("productionTask", "");
|
||||
return null;
|
||||
});
|
||||
// 2、获取原料计划完成情况
|
||||
CompletableFuture<JSONArray> materialTask = CompletableFuture.supplyAsync(() -> WQL.getWO("COCKPIT_PRODUCTION").addParam("flag", "2").process().getResultJSONArray(0), pool);
|
||||
materialTask.thenAccept((result) -> {
|
||||
map.put("materialTask", result);
|
||||
}).exceptionally((e) -> {
|
||||
log.error("获取原料计划完成情况: {}", e.getMessage(), e);
|
||||
map.put("materialTask", "");
|
||||
return null;
|
||||
});
|
||||
// 3、获取成品计划完成情况,今日压制量,干燥量,成品量
|
||||
CompletableFuture<JSONArray> finishedTask = CompletableFuture.supplyAsync(() -> WQL.getWO("COCKPIT_PRODUCTION").addParam("flag", "3").process().getResultJSONArray(0), pool);
|
||||
finishedTask.thenAccept((result) -> {
|
||||
map.put("finishedTask", result);
|
||||
}).exceptionally((e) -> {
|
||||
log.error("获取成品计划完成情况: {}", e.getMessage(), e);
|
||||
map.put("finishedTask", "");
|
||||
return null;
|
||||
});
|
||||
CompletableFuture<Void> allQuery = CompletableFuture.allOf(productionTask, materialTask, finishedTask);
|
||||
CompletableFuture<ConcurrentHashMap<String,Object>> future = allQuery.thenApply((result) -> map).exceptionally((e) -> {
|
||||
log.error(e.getMessage(), e);
|
||||
return null;
|
||||
});
|
||||
future.join();
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 仓储监控大屏信息
|
||||
*
|
||||
* @author gbx
|
||||
* @since 2023/2/27
|
||||
*/
|
||||
@Override
|
||||
public ConcurrentHashMap<String,Object> storageMonitor() {
|
||||
ThreadPoolExecutor pool = ThreadPoolExecutorUtil.getPoll();
|
||||
ConcurrentHashMap<String,Object> map = new ConcurrentHashMap<>();
|
||||
// 1、获取原料仓储信息
|
||||
CompletableFuture<List<SchBasePointDto>> materialStorage = CompletableFuture.supplyAsync(() -> {
|
||||
List<SchBasePointDto> res = new CopyOnWriteArrayList<>();
|
||||
JSONArray result = WQL.getWO("COCKPIT_STORAGE").addParam("flag", "1").process().getResultJSONArray(0);
|
||||
if(ObjectUtil.isNotEmpty(result)) {
|
||||
res = result.toJavaList(SchBasePointDto.class);
|
||||
res.forEach(schBasePointDto -> {
|
||||
//根据入库时间和静置时间判断状态静置状态
|
||||
if(StringUtils.isNotBlank(schBasePointDto.getInstorage_time()) && null != schBasePointDto.getStanding_time()) {
|
||||
DateTime nowTime = DateUtil.parse(DateUtil.now(), DatePattern.NORM_DATETIME_FORMAT);
|
||||
DateTime instorageTime = DateUtil.parse(schBasePointDto.getInstorage_time(), DatePattern.NORM_DATETIME_FORMAT);
|
||||
long minute = DateUtil.between(nowTime, instorageTime, DateUnit.MINUTE);
|
||||
if(minute < schBasePointDto.getStanding_time().longValue()) {
|
||||
schBasePointDto.setStanding_status("静置中");
|
||||
}
|
||||
else{
|
||||
schBasePointDto.setStanding_status("静置完成");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return res;
|
||||
}, pool);
|
||||
materialStorage.thenAccept((result) -> {
|
||||
map.put("materialTask", result);
|
||||
}).exceptionally((e) -> {
|
||||
log.error("获取原料仓储信息: {}", e.getMessage(), e);
|
||||
map.put("materialTask", "");
|
||||
return null;
|
||||
});
|
||||
// 2、获取成品仓储信息
|
||||
CompletableFuture<List<SchBasePointDto>> finishedStorage = CompletableFuture.supplyAsync(() -> {
|
||||
List<SchBasePointDto> res = new CopyOnWriteArrayList<>();
|
||||
JSONArray result = WQL.getWO("COCKPIT_STORAGE").addParam("flag", "1").process().getResultJSONArray(0);
|
||||
if(ObjectUtil.isNotEmpty(result)) {
|
||||
res = result.toJavaList(SchBasePointDto.class);
|
||||
}
|
||||
return res;
|
||||
}, pool);
|
||||
finishedStorage.thenAccept((result) -> {
|
||||
map.put("productionTask", result);
|
||||
}).exceptionally((e) -> {
|
||||
log.error("获取成品仓储信息: {}", e.getMessage(), e);
|
||||
map.put("productionTask", "");
|
||||
return null;
|
||||
});
|
||||
CompletableFuture<Void> allQuery = CompletableFuture.allOf(materialStorage, finishedStorage);
|
||||
CompletableFuture<ConcurrentHashMap<String,Object>> future = allQuery.thenApply((result) -> map).exceptionally((e) -> {
|
||||
log.error(e.getMessage(), e);
|
||||
return null;
|
||||
});
|
||||
future.join();
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备监控大屏信息
|
||||
*
|
||||
* @author gbx
|
||||
* @since 2023/2/27
|
||||
*/
|
||||
@Override
|
||||
public ConcurrentHashMap<String,Object> deviceMonitor() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConcurrentHashMap<String,Object> workshopCondition() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
[交易说明]
|
||||
交易名: 设备监控/1
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.date TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
PAGEQUERY
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
[交易说明]
|
||||
交易名: 生产统计/1
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.date TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
dict.label,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
device.device_name,
|
||||
workorder.*
|
||||
FROM
|
||||
PDM_BD_WORKORDER workorder
|
||||
LEFT JOIN md_me_materialbase material ON material.material_id = workorder.material_id
|
||||
LEFT JOIN pdm_bi_device device ON workorder.device_id = device.device_id
|
||||
LEFT JOIN sys_dict_detail dict ON dict.`VALUE` = workorder.workorder_procedure
|
||||
AND dict.dict_id = 112
|
||||
WHERE
|
||||
workorder.is_delete = '0'
|
||||
AND TO_DAYS(workorder.realproduceend_date) = TO_DAYS(NOW())
|
||||
ORDER BY
|
||||
workorder.create_time DESC
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
SUM( plan_qty ) planQty,
|
||||
SUM( real_qty ) realQty
|
||||
FROM
|
||||
PDM_BD_WORKORDER workorder
|
||||
WHERE
|
||||
workorder.is_delete = '0'
|
||||
AND TO_DAYS(workorder.realproduceend_date) = TO_DAYS(NOW())
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
workorder.workorder_procedure,
|
||||
SUM( plan_qty ) planQty,
|
||||
SUM( real_qty ) realQty
|
||||
FROM
|
||||
PDM_BD_WORKORDER workorder
|
||||
WHERE
|
||||
workorder.is_delete = '0'
|
||||
AND TO_DAYS(workorder.realproduceend_date) = TO_DAYS(NOW())
|
||||
GROUP BY
|
||||
workorder.workorder_procedure
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
[交易说明]
|
||||
交易名: 仓储监控/1
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
point.*
|
||||
FROM
|
||||
sch_base_point point
|
||||
LEFT JOIN md_me_materialbase material ON material.material_id = point.material_id
|
||||
WHERE
|
||||
point.region_code = 'KLHJ'
|
||||
ORDER BY
|
||||
point.create_time DESC
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
point.*
|
||||
FROM
|
||||
sch_base_point point
|
||||
LEFT JOIN md_me_materialbase material ON material.material_id = point.material_id
|
||||
WHERE
|
||||
point.region_code = 'CYZCQ'
|
||||
ORDER BY
|
||||
point.create_time DESC
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
[交易说明]
|
||||
交易名: 车间情况/1
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.date TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
PAGEQUERY
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user