Merge branch 'master' of http://121.40.234.130:8899/root/nladmin
This commit is contained in:
@@ -16,20 +16,25 @@
|
||||
package org.nl.modules.quartz.config;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.quartz.domain.QuartzJob;
|
||||
import org.nl.modules.quartz.repository.QuartzJobRepository;
|
||||
import org.nl.modules.quartz.utils.QuartzManage;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Zheng Jie
|
||||
* @date 2019-01-07
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Order(100)
|
||||
public class JobRunner implements ApplicationRunner {
|
||||
private static final Logger log = LoggerFactory.getLogger(JobRunner.class);
|
||||
private final QuartzJobRepository quartzJobRepository;
|
||||
@@ -42,9 +47,9 @@ public class JobRunner implements ApplicationRunner {
|
||||
*/
|
||||
@Override
|
||||
public void run(ApplicationArguments applicationArguments) {
|
||||
/* log.info("--------------------注入定时任务---------------------");
|
||||
log.info("--------------------注入定时任务---------------------");
|
||||
List<QuartzJob> quartzJobs = quartzJobRepository.findByIsPauseIsFalse();
|
||||
quartzJobs.forEach(quartzManage::addJob);
|
||||
log.info("--------------------定时任务注入完成---------------------");*/
|
||||
log.info("--------------------定时任务注入完成---------------------");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,8 +31,6 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -52,38 +50,24 @@ public class QuartzJobController {
|
||||
@ApiOperation("查询定时任务")
|
||||
@GetMapping
|
||||
@SaCheckPermission("timing:list")
|
||||
public ResponseEntity<Object> query(JobQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(quartzJobService.queryAll(criteria,pageable), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("导出任务数据")
|
||||
@GetMapping(value = "/download")
|
||||
@SaCheckPermission("timing:list")
|
||||
public void download(HttpServletResponse response, JobQueryCriteria criteria) throws IOException {
|
||||
quartzJobService.download(quartzJobService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@ApiOperation("导出日志数据")
|
||||
@GetMapping(value = "/logs/download")
|
||||
@SaCheckPermission("timing:list")
|
||||
public void downloadLog(HttpServletResponse response, JobQueryCriteria criteria) throws IOException {
|
||||
quartzJobService.downloadLog(quartzJobService.queryAllLog(criteria), response);
|
||||
public ResponseEntity<Object> query(JobQueryCriteria criteria, Pageable pageable) {
|
||||
return new ResponseEntity<>(quartzJobService.queryAll(criteria, pageable), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("查询任务执行日志")
|
||||
@GetMapping(value = "/logs")
|
||||
@SaCheckPermission("timing:list")
|
||||
public ResponseEntity<Object> queryJobLog(JobQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(quartzJobService.queryAllLog(criteria,pageable), HttpStatus.OK);
|
||||
public ResponseEntity<Object> queryJobLog(JobQueryCriteria criteria, Pageable pageable) {
|
||||
return new ResponseEntity<>(quartzJobService.queryAllLog(criteria, pageable), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("新增定时任务")
|
||||
@ApiOperation("新增定时任务")
|
||||
@PostMapping
|
||||
@SaCheckPermission("timing:add")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody QuartzJob resources){
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody QuartzJob resources) {
|
||||
if (resources.getId() != null) {
|
||||
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
||||
throw new BadRequestException("A new " + ENTITY_NAME + " cannot already have an ID");
|
||||
}
|
||||
quartzJobService.create(resources);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
@@ -93,7 +77,7 @@ public class QuartzJobController {
|
||||
@ApiOperation("修改定时任务")
|
||||
@PutMapping
|
||||
@SaCheckPermission("timing:edit")
|
||||
public ResponseEntity<Object> update(@Validated(QuartzJob.Update.class) @RequestBody QuartzJob resources){
|
||||
public ResponseEntity<Object> update(@Validated(QuartzJob.Update.class) @RequestBody QuartzJob resources) {
|
||||
quartzJobService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
@@ -102,7 +86,7 @@ public class QuartzJobController {
|
||||
@ApiOperation("更改定时任务状态")
|
||||
@PutMapping(value = "/{id}")
|
||||
@SaCheckPermission("timing:edit")
|
||||
public ResponseEntity<Object> update(@PathVariable Long id){
|
||||
public ResponseEntity<Object> update(@PathVariable Long id) {
|
||||
quartzJobService.updateIsPause(quartzJobService.findById(id));
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
@@ -111,7 +95,7 @@ public class QuartzJobController {
|
||||
@ApiOperation("执行定时任务")
|
||||
@PutMapping(value = "/exec/{id}")
|
||||
@SaCheckPermission("timing:edit")
|
||||
public ResponseEntity<Object> execution(@PathVariable Long id){
|
||||
public ResponseEntity<Object> execution(@PathVariable Long id) {
|
||||
quartzJobService.execution(quartzJobService.findById(id));
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
@@ -120,7 +104,7 @@ public class QuartzJobController {
|
||||
@ApiOperation("删除定时任务")
|
||||
@DeleteMapping
|
||||
@SaCheckPermission("timing:del")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<Long> ids){
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<Long> ids) {
|
||||
quartzJobService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -20,8 +20,6 @@ import org.nl.modules.quartz.domain.QuartzLog;
|
||||
import org.nl.modules.quartz.service.dto.JobQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -33,6 +31,7 @@ public interface QuartzJobService {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return /
|
||||
@@ -41,6 +40,7 @@ public interface QuartzJobService {
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param criteria 条件
|
||||
* @return /
|
||||
*/
|
||||
@@ -48,6 +48,7 @@ public interface QuartzJobService {
|
||||
|
||||
/**
|
||||
* 分页查询日志
|
||||
*
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return /
|
||||
@@ -56,6 +57,7 @@ public interface QuartzJobService {
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param criteria 条件
|
||||
* @return /
|
||||
*/
|
||||
@@ -63,24 +65,28 @@ public interface QuartzJobService {
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param resources /
|
||||
*/
|
||||
void create(QuartzJob resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param resources /
|
||||
*/
|
||||
void update(QuartzJob resources);
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
*
|
||||
* @param ids /
|
||||
*/
|
||||
void delete(Set<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return /
|
||||
*/
|
||||
@@ -88,34 +94,22 @@ public interface QuartzJobService {
|
||||
|
||||
/**
|
||||
* 更改定时任务状态
|
||||
*
|
||||
* @param quartzJob /
|
||||
*/
|
||||
void updateIsPause(QuartzJob quartzJob);
|
||||
|
||||
/**
|
||||
* 立即执行定时任务
|
||||
*
|
||||
* @param quartzJob /
|
||||
*/
|
||||
void execution(QuartzJob quartzJob);
|
||||
|
||||
/**
|
||||
* 导出定时任务
|
||||
* @param queryAll 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<QuartzJob> queryAll, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 导出定时任务日志
|
||||
* @param queryAllLog 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void downloadLog(List<QuartzLog> queryAllLog, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 执行子任务
|
||||
*
|
||||
* @param tasks /
|
||||
* @throws InterruptedException /
|
||||
*/
|
||||
|
||||
@@ -19,7 +19,10 @@ import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.*;
|
||||
import org.nl.modules.common.utils.PageUtil;
|
||||
import org.nl.modules.common.utils.QueryHelp;
|
||||
import org.nl.modules.common.utils.RedisUtils;
|
||||
import org.nl.modules.common.utils.ValidationUtil;
|
||||
import org.nl.modules.quartz.domain.QuartzJob;
|
||||
import org.nl.modules.quartz.domain.QuartzLog;
|
||||
import org.nl.modules.quartz.repository.QuartzJobRepository;
|
||||
@@ -33,9 +36,9 @@ import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Zheng Jie
|
||||
@@ -51,36 +54,36 @@ public class QuartzJobServiceImpl implements QuartzJobService {
|
||||
private final RedisUtils redisUtils;
|
||||
|
||||
@Override
|
||||
public Object queryAll(JobQueryCriteria criteria, Pageable pageable){
|
||||
return PageUtil.toPage(quartzJobRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable));
|
||||
public Object queryAll(JobQueryCriteria criteria, Pageable pageable) {
|
||||
return PageUtil.toPage(quartzJobRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object queryAllLog(JobQueryCriteria criteria, Pageable pageable){
|
||||
return PageUtil.toPage(quartzLogRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable));
|
||||
public Object queryAllLog(JobQueryCriteria criteria, Pageable pageable) {
|
||||
return PageUtil.toPage(quartzLogRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzJob> queryAll(JobQueryCriteria criteria) {
|
||||
return quartzJobRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder));
|
||||
return quartzJobRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzLog> queryAllLog(JobQueryCriteria criteria) {
|
||||
return quartzLogRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder));
|
||||
return quartzLogRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder));
|
||||
}
|
||||
|
||||
@Override
|
||||
public QuartzJob findById(Long id) {
|
||||
QuartzJob quartzJob = quartzJobRepository.findById(id).orElseGet(QuartzJob::new);
|
||||
ValidationUtil.isNull(quartzJob.getId(),"QuartzJob","id",id);
|
||||
ValidationUtil.isNull(quartzJob.getId(), "QuartzJob", "id", id);
|
||||
return quartzJob;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(QuartzJob resources) {
|
||||
if (!CronExpression.isValidExpression(resources.getCronExpression())){
|
||||
if (!CronExpression.isValidExpression(resources.getCronExpression())) {
|
||||
throw new BadRequestException("cron表达式格式错误");
|
||||
}
|
||||
resources = quartzJobRepository.save(resources);
|
||||
@@ -90,10 +93,10 @@ public class QuartzJobServiceImpl implements QuartzJobService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(QuartzJob resources) {
|
||||
if (!CronExpression.isValidExpression(resources.getCronExpression())){
|
||||
if (!CronExpression.isValidExpression(resources.getCronExpression())) {
|
||||
throw new BadRequestException("cron表达式格式错误");
|
||||
}
|
||||
if(StrUtil.isNotEmpty(resources.getSubTask())){
|
||||
if (StrUtil.isNotEmpty(resources.getSubTask())) {
|
||||
List<String> tasks = Arrays.asList(resources.getSubTask().split("[,,]"));
|
||||
if (tasks.contains(resources.getId().toString())) {
|
||||
throw new BadRequestException("子任务中不能添加当前任务ID");
|
||||
@@ -148,47 +151,11 @@ public class QuartzJobServiceImpl implements QuartzJobService {
|
||||
Thread.sleep(5000);
|
||||
result = (Boolean) redisUtils.get(uuid);
|
||||
}
|
||||
if(!result){
|
||||
if (!result) {
|
||||
redisUtils.del(uuid);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<QuartzJob> quartzJobs, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (QuartzJob quartzJob : quartzJobs) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("任务名称", quartzJob.getJobName());
|
||||
map.put("Bean名称", quartzJob.getBeanName());
|
||||
map.put("执行方法", quartzJob.getMethodName());
|
||||
map.put("参数", quartzJob.getParams());
|
||||
map.put("表达式", quartzJob.getCronExpression());
|
||||
map.put("状态", quartzJob.getIsPause() ? "暂停中" : "运行中");
|
||||
map.put("描述", quartzJob.getDescription());
|
||||
map.put("创建日期", quartzJob.getCreateTime());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadLog(List<QuartzLog> queryAllLog, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (QuartzLog quartzLog : queryAllLog) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("任务名称", quartzLog.getJobName());
|
||||
map.put("Bean名称", quartzLog.getBeanName());
|
||||
map.put("执行方法", quartzLog.getMethodName());
|
||||
map.put("参数", quartzLog.getParams());
|
||||
map.put("表达式", quartzLog.getCronExpression());
|
||||
map.put("异常详情", quartzLog.getExceptionDetail());
|
||||
map.put("耗时/毫秒", quartzLog.getTime());
|
||||
map.put("状态", quartzLog.getIsSuccess() ? "成功" : "失败");
|
||||
map.put("创建日期", quartzLog.getCreateTime());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
package org.nl.modules.quartz.task;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class TestSch {
|
||||
public void run() {
|
||||
log.info("run 执行成功1");
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
package org.nl.modules.quartz.task;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
@@ -28,6 +29,7 @@ import org.springframework.stereotype.Component;
|
||||
public class TestTask {
|
||||
|
||||
public void run(){
|
||||
|
||||
log.info("run 执行成功");
|
||||
}
|
||||
|
||||
@@ -36,6 +38,7 @@ public class TestTask {
|
||||
}
|
||||
|
||||
public void run2(){
|
||||
WQLObject.getWQLObject("sys_param");
|
||||
log.info("run2 执行成功");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
package org.nl.modules.security.rest;
|
||||
|
||||
import cn.dev33.satoken.secure.SaSecureUtil;
|
||||
|
||||
/**
|
||||
* @author lyd
|
||||
* @description 密码加密测试
|
||||
*/
|
||||
public class test {
|
||||
public static void main(String[] args) {
|
||||
String salt = SaSecureUtil.md5BySalt("123456", "salt");
|
||||
System.out.println(salt);
|
||||
}
|
||||
}
|
||||
@@ -98,12 +98,11 @@ public class ParamServiceImpl implements ParamService {
|
||||
ParamDto entity = this.findById(dto.getId());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
CurrentUser currentUsername = SecurityUtils.getCurrentUser();
|
||||
String now = DateUtil.now();
|
||||
|
||||
dto.setUpdate_optid(StpUtil.getLoginIdAsLong());
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_optname(currentUsername.getNickName());
|
||||
dto.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("sys_param");
|
||||
JSONObject json = JSONObject.parseObject( JSONObject.toJSONString(dto));
|
||||
|
||||
19
nladmin-system/src/main/java/org/nl/modules/wql/WQLInit.java
Normal file
19
nladmin-system/src/main/java/org/nl/modules/wql/WQLInit.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package org.nl.modules.wql;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Order(0)
|
||||
@Component
|
||||
@Slf4j
|
||||
public class WQLInit implements ApplicationRunner {
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
WQLCore.ROOT = "org.nl";
|
||||
WQLCore.init();
|
||||
log.info("WQL初始化成功!");
|
||||
}
|
||||
}
|
||||
@@ -2,16 +2,10 @@ package org.nl.start;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.quartz.domain.QuartzJob;
|
||||
import org.nl.modules.quartz.repository.QuartzJobRepository;
|
||||
import org.nl.modules.quartz.utils.QuartzManage;
|
||||
import org.nl.modules.wql.WQLCore;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 随项目启动模块
|
||||
*/
|
||||
@@ -19,34 +13,9 @@ import java.util.List;
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class Init implements ApplicationRunner {
|
||||
private final QuartzJobRepository quartzJobRepository;
|
||||
private final QuartzManage quartzManage;
|
||||
|
||||
|
||||
private void init() throws Exception {
|
||||
//初始化WQL
|
||||
initWql();
|
||||
//初始化任务调度
|
||||
initQuartz();
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
System.out.println("项目启动成功!");
|
||||
}
|
||||
|
||||
private void initQuartz() {
|
||||
log.info("--------------------注入定时任务---------------------");
|
||||
List<QuartzJob> quartzJobs = quartzJobRepository.findByIsPauseIsFalse();
|
||||
quartzJobs.forEach(quartzManage::addJob);
|
||||
log.info("--------------------定时任务注入完成---------------------");
|
||||
|
||||
}
|
||||
|
||||
private void initWql() throws Exception {
|
||||
WQLCore.ROOT = "org.nl";
|
||||
WQLCore.init();
|
||||
log.info("WQL初始化成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
this.init();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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