代码更新
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package org.nl.wms.ext.mes.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.ext.mes.service.MesToLmsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -23,11 +27,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
* "RTYPE": "S",
|
||||
* "RTMSG": "成功",
|
||||
* "RTOAL": 1,
|
||||
* "RTDAT": [{
|
||||
* "ContainerName": "母卷号",
|
||||
* "ResourceName": "设备号",
|
||||
* "Weight": 80
|
||||
* }]
|
||||
* "RTDAT": null
|
||||
* }
|
||||
*
|
||||
*
|
||||
@@ -37,12 +37,73 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
public JSONObject momRollFoilStart(JSONObject param) {
|
||||
log.info("momRollFoilStart接口输入参数为:-------------------"+param.toString());
|
||||
|
||||
String containerName = param.getString("ContainerName");
|
||||
String ResourceName = param.getString("ResourceName");
|
||||
String MfgOrderName = param.getString("MfgOrderName");
|
||||
String ProductName = param.getString("ProductName");
|
||||
String Description = param.getString("Description");
|
||||
String TheoryHeight = param.getString("TheoryHeight");
|
||||
String EqpVelocity = param.getString("EqpVelocity");
|
||||
String UpCoilerDate = param.getString("UpCoilerDate");
|
||||
String IsReloadSend = param.getString("IsReloadSend");
|
||||
|
||||
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
WQLObject orderTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("RTYPE", "S");
|
||||
result.put("RTMSG", "操作成功!");
|
||||
result.put("RTOAL", 0);
|
||||
result.put("RTDAT", new JSONArray());
|
||||
System.out.println(result);
|
||||
try {
|
||||
// 校验数据
|
||||
if (ObjectUtil.isEmpty(containerName)) throw new BadRequestException("母卷号不能为空");
|
||||
if (ObjectUtil.isEmpty(ResourceName)) throw new BadRequestException("机台编码不能为空");
|
||||
if (ObjectUtil.isEmpty(MfgOrderName)) throw new BadRequestException("生产工单不能为空");
|
||||
if (ObjectUtil.isEmpty(ProductName)) throw new BadRequestException("产品编码不能为空");
|
||||
if (ObjectUtil.isEmpty(Description)) throw new BadRequestException("产品名称不能为空");
|
||||
if (ObjectUtil.isEmpty(TheoryHeight)) throw new BadRequestException("理论长度不能为空");
|
||||
if (ObjectUtil.isEmpty(EqpVelocity)) throw new BadRequestException("生产速度不能为空");
|
||||
if (ObjectUtil.isEmpty(UpCoilerDate)) throw new BadRequestException("开始时间不能为空");
|
||||
if (ObjectUtil.isEmpty(IsReloadSend)) throw new BadRequestException("是否重新更新不能为空");
|
||||
|
||||
JSONObject jsonPoint = pointTab.query("ext_code ='" + ResourceName + "' and is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("对应点位不存在");
|
||||
|
||||
// 插入生箔工序工单表
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("workorder_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
json.put("container_name",containerName);
|
||||
json.put("resource_name",ResourceName);
|
||||
json.put("mfg_order_name",MfgOrderName);
|
||||
json.put("product_name",ProductName);
|
||||
json.put("description",Description);
|
||||
json.put("theory_height",TheoryHeight);
|
||||
json.put("eqp_velocity",EqpVelocity);
|
||||
json.put("up_coiler_date",UpCoilerDate);
|
||||
json.put("is_reload_send",IsReloadSend);
|
||||
json.put("product_area", jsonPoint.getString("product_area"));
|
||||
json.put("point_code", jsonPoint.getString("point_code"));
|
||||
json.put("realstart_time", DateUtil.now());
|
||||
json.put("status", "01");
|
||||
json.put("is_delete", "0");
|
||||
json.put("agvno", "0");
|
||||
json.put("productin_qty", 0);
|
||||
json.put("create_id", "1");
|
||||
json.put("create_name", "管理员");
|
||||
json.put("create_time", DateUtil.now());
|
||||
orderTab.insert(json);
|
||||
|
||||
// 返回成功
|
||||
result.put("RTYPE", "S");
|
||||
result.put("RTMSG", "操作成功!");
|
||||
result.put("RTOAL", 1);
|
||||
result.put("RTDAT", null);
|
||||
System.out.println(result);
|
||||
} catch (Exception e) {
|
||||
// 返回失败
|
||||
result.put("RTYPE", "S");
|
||||
result.put("RTMSG", "操作失败!"+e.getMessage());
|
||||
result.put("RTOAL", 0);
|
||||
result.put("RTDAT", null);
|
||||
System.out.println(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
|
||||
package org.nl.wms.pdm.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.pdm.service.RawfoilworkorderService;
|
||||
import org.nl.wms.pdm.service.dto.RawfoilworkorderDto;
|
||||
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 cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @date 2022-10-08
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "生箔工序工单管理")
|
||||
@RequestMapping("/api/rawfoilworkorder")
|
||||
@Slf4j
|
||||
public class RawfoilworkorderController {
|
||||
|
||||
private final RawfoilworkorderService rawfoilworkorderService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询生箔工序工单")
|
||||
@ApiOperation("查询生箔工序工单")
|
||||
//@SaCheckPermission("@el.check('rawfoilworkorder:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(rawfoilworkorderService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增生箔工序工单")
|
||||
@ApiOperation("新增生箔工序工单")
|
||||
//@SaCheckPermission("@el.check('rawfoilworkorder:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody RawfoilworkorderDto dto) {
|
||||
rawfoilworkorderService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改生箔工序工单")
|
||||
@ApiOperation("修改生箔工序工单")
|
||||
//@SaCheckPermission("@el.check('rawfoilworkorder:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody RawfoilworkorderDto dto) {
|
||||
rawfoilworkorderService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除生箔工序工单")
|
||||
@ApiOperation("删除生箔工序工单")
|
||||
//@SaCheckPermission("@el.check('rawfoilworkorder:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
rawfoilworkorderService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("强制确认")
|
||||
@ApiOperation("强制确认")
|
||||
@PostMapping("/compelEnd")
|
||||
public ResponseEntity<Object> compelEnd(@RequestBody JSONObject whereJson) {
|
||||
rawfoilworkorderService.compelEnd(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
|
||||
package org.nl.wms.pdm.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.pdm.service.dto.RawfoilworkorderDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @description 服务接口
|
||||
* @date 2022-10-08
|
||||
**/
|
||||
public interface RawfoilworkorderService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
*
|
||||
* @param whereJson 条件参数
|
||||
* @return List<RawfoilworkorderDto>
|
||||
*/
|
||||
List<RawfoilworkorderDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param workorder_id ID
|
||||
* @return Rawfoilworkorder
|
||||
*/
|
||||
RawfoilworkorderDto findById(Long workorder_id);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
*
|
||||
* @param code code
|
||||
* @return Rawfoilworkorder
|
||||
*/
|
||||
RawfoilworkorderDto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void create(RawfoilworkorderDto dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void update(RawfoilworkorderDto dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
*
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
/**
|
||||
* 强制确认
|
||||
*
|
||||
* @param whereJson /
|
||||
*/
|
||||
void compelEnd(JSONObject whereJson);
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
package org.nl.wms.pdm.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 liuxy
|
||||
* @description /
|
||||
* @date 2022-10-08
|
||||
**/
|
||||
@Data
|
||||
public class RawfoilworkorderDto implements Serializable {
|
||||
|
||||
/** 工单标识 */
|
||||
/**
|
||||
* 防止精度丢失
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long workorder_id;
|
||||
|
||||
/**
|
||||
* 母卷号
|
||||
*/
|
||||
private String container_name;
|
||||
|
||||
/**
|
||||
* 机台编码
|
||||
*/
|
||||
private String resource_name;
|
||||
|
||||
/**
|
||||
* 生产工单
|
||||
*/
|
||||
private String mfg_order_name;
|
||||
|
||||
/**
|
||||
* 产品编码
|
||||
*/
|
||||
private String product_name;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 理论长度
|
||||
*/
|
||||
private BigDecimal theory_height;
|
||||
|
||||
/**
|
||||
* 设备生产速度
|
||||
*/
|
||||
private BigDecimal eqp_velocity;
|
||||
|
||||
/**
|
||||
* 上卷开始时间
|
||||
*/
|
||||
private String up_coiler_date;
|
||||
|
||||
/**
|
||||
* 是否重新更新
|
||||
*/
|
||||
private String is_reload_send;
|
||||
|
||||
/**
|
||||
* 重量
|
||||
*/
|
||||
private BigDecimal productin_qty;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String realstart_time;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private String realend_time;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 完成方式
|
||||
*/
|
||||
private String finish_type;
|
||||
|
||||
/**
|
||||
* 车号
|
||||
*/
|
||||
private String agvno;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
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 String is_delete;
|
||||
|
||||
/**
|
||||
* 生产区域
|
||||
*/
|
||||
private String product_area;
|
||||
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
private String point_code;
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
|
||||
package org.nl.wms.pdm.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.wms.pdm.service.RawfoilworkorderService;
|
||||
import org.nl.wms.pdm.service.dto.RawfoilworkorderDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @description 服务实现
|
||||
* @date 2022-10-08
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class RawfoilworkorderServiceImpl implements RawfoilworkorderService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String product_area = MapUtil.getStr(whereJson, "product_area");
|
||||
String resource_name = MapUtil.getStr(whereJson, "resource_name");
|
||||
String status = MapUtil.getStr(whereJson, "status");
|
||||
String container_name = MapUtil.getStr(whereJson, "container_name");
|
||||
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
if (ObjectUtil.isNotEmpty(resource_name)) map.put("resource_name","%"+resource_name+"%");
|
||||
if (ObjectUtil.isNotEmpty(container_name)) map.put("container_name","%"+container_name+"%");
|
||||
map.put("begin_time",begin_time);
|
||||
map.put("end_time",end_time);
|
||||
map.put("product_area",product_area);
|
||||
map.put("status",status);
|
||||
|
||||
JSONObject json = WQL.getWO("PDM_BI_RAWFOILWORKORDER_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "der.update_time DESC");
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RawfoilworkorderDto> queryAll(Map whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(RawfoilworkorderDto.class);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RawfoilworkorderDto findById(Long workorder_id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder");
|
||||
JSONObject json = wo.query("workorder_id = '" + workorder_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(RawfoilworkorderDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RawfoilworkorderDto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder");
|
||||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(RawfoilworkorderDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(RawfoilworkorderDto dto) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
dto.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextId());
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(RawfoilworkorderDto dto) {
|
||||
RawfoilworkorderDto entity = this.findById(dto.getWorkorder_id());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder");
|
||||
for (Long workorder_id : ids) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("workorder_id", String.valueOf(workorder_id));
|
||||
param.put("is_delete", "1");
|
||||
param.put("update_optid", currentUserId);
|
||||
param.put("update_optname", nickName);
|
||||
param.put("update_time", now);
|
||||
wo.update(param);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void compelEnd(JSONObject whereJson) {
|
||||
String workorder_id = whereJson.getString("workorder_id");
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
WQLObject tab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
|
||||
|
||||
JSONObject json = tab.query("workorder_id = '" + workorder_id + "'").uniqueResult(0);
|
||||
json.put("status", "02");
|
||||
json.put("finish_type", "02");
|
||||
json.put("realend_time", DateUtil.now());
|
||||
json.put("update_optid", currentUserId);
|
||||
json.put("update_optname", currentUsername);
|
||||
json.put("update_time", DateUtil.now());
|
||||
tab.update(json);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
[交易说明]
|
||||
交易名: 生箔工单查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.resource_name TYPEAS s_string
|
||||
输入.container_name TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.status TYPEAS s_string
|
||||
输入.product_area TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
der.*
|
||||
FROM
|
||||
pdm_bi_rawfoilworkorder der
|
||||
WHERE
|
||||
der.is_delete = '0'
|
||||
|
||||
OPTION 输入.resource_name <> ""
|
||||
der.resource_name like 输入.resource_name
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.container_name <> ""
|
||||
der.container_name like 输入.container_name
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.product_area <> ""
|
||||
der.product_area = 输入.product_area
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.status <> ""
|
||||
der.status = 输入.status
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.begin_time <> ""
|
||||
der.create_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.end_time <> ""
|
||||
der.create_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
Reference in New Issue
Block a user