add:手持设备接口开发
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
|
||||
package org.nl.wms.device_manage.pda.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.device_manage.pda.service.PdaDeviceLubriCateService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @date 2022-06-22
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "手持润滑单管理")
|
||||
@RequestMapping("/api/pda/device/lubricate")
|
||||
@Slf4j
|
||||
public class PdaDeviceLubriCateController {
|
||||
|
||||
private final PdaDeviceLubriCateService pdaDeviceLubriCateService;
|
||||
|
||||
@PostMapping("/getAllQuery")
|
||||
@ApiOperation("设备润滑页面查询")
|
||||
public ResponseEntity<Object> getAllQuery(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceLubriCateService.getAllQuery(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/begin")
|
||||
@ApiOperation("开始润滑")
|
||||
public ResponseEntity<Object> begin(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceLubriCateService.begin(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getDtl")
|
||||
@ApiOperation("获取明细")
|
||||
public ResponseEntity<Object> getDtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceLubriCateService.getDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@ApiOperation("结束润滑确认")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceLubriCateService.confirm(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
package org.nl.wms.device_manage.pda.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.device_manage.pda.service.PdaDeviceManageService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @date 2022-06-22
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "手持设备管理")
|
||||
@RequestMapping("/api/pda/device/manage")
|
||||
@Slf4j
|
||||
public class PdaDeviceManageController {
|
||||
|
||||
private final PdaDeviceManageService pdaDeviceManageService;
|
||||
|
||||
@PostMapping("/getAllQuery")
|
||||
@ApiOperation("设备作业页面查询")
|
||||
public ResponseEntity<Object> getAllQuery(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceManageService.getAllQuery(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getDtl")
|
||||
@ApiOperation("设备作业明细页面查询")
|
||||
public ResponseEntity<Object> getDtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceManageService.getDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@ApiOperation("审核")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceManageService.confirm(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
|
||||
package org.nl.wms.device_manage.pda.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.device_manage.pda.service.PdaDeviceRepairService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @date 2022-06-22
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "手持维修单管理")
|
||||
@RequestMapping("/api/pda/device/repair")
|
||||
@Slf4j
|
||||
public class PdaDeviceRepairController {
|
||||
|
||||
private final PdaDeviceRepairService pdaDeviceRepairService;
|
||||
|
||||
@PostMapping("/getAllQuery")
|
||||
@ApiOperation("设备维修页面查询")
|
||||
public ResponseEntity<Object> getAllQuery(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceRepairService.getAllQuery(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/begin")
|
||||
@ApiOperation("开始维修")
|
||||
public ResponseEntity<Object> begin(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceRepairService.begin(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getDtl")
|
||||
@ApiOperation("获取明细")
|
||||
public ResponseEntity<Object> getDtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceRepairService.getDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@ApiOperation("结束维修确认")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceRepairService.confirm(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
|
||||
package org.nl.wms.device_manage.pda.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.device_manage.pda.service.PdaDeviceSportCheckService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @date 2022-06-22
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "手持点检单管理")
|
||||
@RequestMapping("/api/pda/device/sportcheck")
|
||||
@Slf4j
|
||||
public class PdaDeviceSportCheckController {
|
||||
|
||||
private final PdaDeviceSportCheckService pdaDeviceSportCheckService;
|
||||
|
||||
@PostMapping("/getAllQuery")
|
||||
@ApiOperation("设备点检页面查询")
|
||||
public ResponseEntity<Object> getAllQuery(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceSportCheckService.getAllQuery(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/begin")
|
||||
@ApiOperation("开始点检")
|
||||
public ResponseEntity<Object> begin(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceSportCheckService.begin(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getDtl")
|
||||
@ApiOperation("获取明细")
|
||||
public ResponseEntity<Object> getDtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceSportCheckService.getDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@ApiOperation("结束点检确认")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceSportCheckService.confirm(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
|
||||
package org.nl.wms.device_manage.pda.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.device_manage.pda.service.PdaDeviceUpkeepService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @date 2022-06-22
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "手持保养单管理")
|
||||
@RequestMapping("/api/pda/device/upkeep")
|
||||
@Slf4j
|
||||
public class PdaDeviceUpkeepController {
|
||||
|
||||
private final PdaDeviceUpkeepService pdaDeviceUpkeepService;
|
||||
|
||||
@PostMapping("/getAllQuery")
|
||||
@ApiOperation("设备保养页面查询")
|
||||
public ResponseEntity<Object> getAllQuery(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceUpkeepService.getAllQuery(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/begin")
|
||||
@ApiOperation("开始保养")
|
||||
public ResponseEntity<Object> begin(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceUpkeepService.begin(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getDtl")
|
||||
@ApiOperation("获取明细")
|
||||
public ResponseEntity<Object> getDtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceUpkeepService.getDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@ApiOperation("结束保养确认")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaDeviceUpkeepService.confirm(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
|
||||
package org.nl.wms.device_manage.pda.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务接口
|
||||
* @date 2022-06-22
|
||||
**/
|
||||
public interface PdaDeviceLubriCateService {
|
||||
|
||||
/**
|
||||
* 设备润滑页面查询
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject getAllQuery(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 开始润滑
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject begin(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 获取明细
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject getDtl(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 结束润滑确认
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject confirm(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 审核
|
||||
* @param whereJson /
|
||||
*/
|
||||
void audit(JSONObject whereJson);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
package org.nl.wms.device_manage.pda.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务接口
|
||||
* @date 2022-06-22
|
||||
**/
|
||||
public interface PdaDeviceManageService {
|
||||
|
||||
/**
|
||||
* 设备作业页面查询
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject getAllQuery(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 设备作业明细页面查询
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject getDtl(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 审核
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject confirm(JSONObject whereJson);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
|
||||
package org.nl.wms.device_manage.pda.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务接口
|
||||
* @date 2022-06-22
|
||||
**/
|
||||
public interface PdaDeviceRepairService {
|
||||
|
||||
/**
|
||||
* 设备维修页面查询
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject getAllQuery(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 开始维修
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject begin(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 获取明细
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject getDtl(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 结束维修确认
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject confirm(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 审核
|
||||
* @param whereJson /
|
||||
*/
|
||||
void audit(JSONObject whereJson);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
|
||||
package org.nl.wms.device_manage.pda.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务接口
|
||||
* @date 2022-06-22
|
||||
**/
|
||||
public interface PdaDeviceSportCheckService {
|
||||
|
||||
/**
|
||||
* 设备点检页面查询
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject getAllQuery(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 开始点检
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject begin(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 获取明细
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject getDtl(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 结束点检确认
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject confirm(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 审核
|
||||
* @param whereJson /
|
||||
*/
|
||||
void audit(JSONObject whereJson);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
|
||||
package org.nl.wms.device_manage.pda.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务接口
|
||||
* @date 2022-06-22
|
||||
**/
|
||||
public interface PdaDeviceUpkeepService {
|
||||
|
||||
/**
|
||||
* 设备保养页面查询
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject getAllQuery(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 开始保养
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject begin(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 获取明细
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject getDtl(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 结束保养确认
|
||||
* @param whereJson /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject confirm(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 审核
|
||||
* @param whereJson /
|
||||
*/
|
||||
void audit(JSONObject whereJson);
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
|
||||
package org.nl.wms.device_manage.pda.service.impl;
|
||||
|
||||
|
||||
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.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.device_manage.lubricate.service.DevicelubricatemstService;
|
||||
import org.nl.wms.device_manage.pda.service.PdaDeviceLubriCateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务实现
|
||||
* @date 2022-06-22
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class PdaDeviceLubriCateServiceImpl implements PdaDeviceLubriCateService {
|
||||
|
||||
@Autowired
|
||||
private DevicelubricatemstService devicelubricatemstService;
|
||||
|
||||
@Override
|
||||
public JSONObject getAllQuery(JSONObject whereJson) {
|
||||
String device_code = whereJson.getString("device_code");
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_DEVICELUBRICATE_01").addParam("flag", "1")
|
||||
.addParam("device_code", ObjectUtil.isNotEmpty(device_code) ? "%" + device_code + "%" : "")
|
||||
.process().getResultJSONArray(0);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("data", resultJSONArray);
|
||||
result.put("message", "查询成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject begin(JSONObject whereJson) {
|
||||
JSONObject row = whereJson.getJSONObject("row");
|
||||
|
||||
// 组织数据
|
||||
row.put("update_optname", SecurityUtils.getCurrentNickName()); // 润滑人
|
||||
|
||||
// 调用润滑务接口
|
||||
devicelubricatemstService.startMaintain(row);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDtl(JSONObject whereJson) {
|
||||
|
||||
String maint_id = whereJson.getString("maint_id");
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_DEVICELUBRICATE_01").addParam("flag", "2")
|
||||
.addParam("maint_id", maint_id).process().getResultJSONArray(0);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("data", resultJSONArray);
|
||||
result.put("message", "查询成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject confirm(JSONObject whereJson) {
|
||||
WQLObject MstTab = WQLObject.getWQLObject("EM_BI_DeviceLubricateMst"); // 设备润滑单主表
|
||||
|
||||
// 组织数据
|
||||
JSONObject jsonMst = MstTab.query("maint_code = '" + whereJson.getString("maint_code") + "'").uniqueResult(0);
|
||||
jsonMst.put("tableData", whereJson.getJSONArray("rows"));
|
||||
|
||||
devicelubricatemstService.endMaintain(jsonMst);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void audit(JSONObject whereJson) {
|
||||
WQLObject MstTab = WQLObject.getWQLObject("EM_BI_DeviceLubricateMst"); // 设备润滑单主表
|
||||
JSONObject jsonMst = MstTab.query("maint_code = '" + whereJson.getString("job_code") + "'").uniqueResult(0);
|
||||
devicelubricatemstService.auditMaintain(jsonMst);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
|
||||
package org.nl.wms.device_manage.pda.service.impl;
|
||||
|
||||
|
||||
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.wql.WQL;
|
||||
import org.nl.wms.device_manage.pda.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务实现
|
||||
* @date 2022-06-22
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class PdaDeviceManageServiceImpl implements PdaDeviceManageService {
|
||||
|
||||
@Autowired
|
||||
private PdaDeviceRepairService pdaDeviceRepairService; // 手持维修服务
|
||||
|
||||
@Autowired
|
||||
private PdaDeviceUpkeepService pdaDeviceUpkeepService; // 手持保养服务
|
||||
|
||||
@Autowired
|
||||
private PdaDeviceSportCheckService pdaDeviceSportCheckService; // 手持点检服务
|
||||
|
||||
@Autowired
|
||||
private PdaDeviceLubriCateService pdaDeviceLubriCateService; // 手持润滑服务
|
||||
|
||||
@Override
|
||||
public JSONObject getAllQuery(JSONObject whereJson) {
|
||||
String device_code = whereJson.getString("device_code");
|
||||
String job_type = whereJson.getString("job_type");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(job_type)) {
|
||||
switch (job_type) {
|
||||
case "1" : job_type = "WXD";
|
||||
break;
|
||||
case "2" : job_type = "BYD";
|
||||
break;
|
||||
case "3" : job_type = "DJD";
|
||||
break;
|
||||
case "4" : job_type = "RHD";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_DEVICEMANAGE_01").addParam("flag", "1")
|
||||
.addParam("device_code", ObjectUtil.isNotEmpty(device_code) ? "%" + device_code + "%" : "")
|
||||
.addParam("job_type", job_type)
|
||||
.process().getResultJSONArray(0);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("data", resultJSONArray);
|
||||
result.put("message", "查询成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDtl(JSONObject whereJson) {
|
||||
String job_code = whereJson.getString("job_code");
|
||||
String job_type = whereJson.getString("job_type");
|
||||
|
||||
String flag = "2";
|
||||
if (ObjectUtil.isNotEmpty(job_type)) {
|
||||
switch (job_type) {
|
||||
case "1":
|
||||
flag = "2";
|
||||
break;
|
||||
case "2":
|
||||
flag = "3";
|
||||
break;
|
||||
case "3":
|
||||
flag = "4";
|
||||
break;
|
||||
case "4":
|
||||
flag = "5";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_DEVICEMANAGE_01")
|
||||
.addParam("flag", flag)
|
||||
.addParam("job_code", job_code)
|
||||
.process().getResultJSONArray(0);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("data", resultJSONArray);
|
||||
result.put("message", "查询成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject confirm(JSONObject whereJson) {
|
||||
JSONArray rows = whereJson.getJSONArray("rows");
|
||||
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject row = rows.getJSONObject(i);
|
||||
|
||||
String job_type = row.getString("job_type");
|
||||
switch (job_type) {
|
||||
case "1":
|
||||
// 维修
|
||||
pdaDeviceRepairService.audit(row);
|
||||
break;
|
||||
case "2":
|
||||
// 保养
|
||||
pdaDeviceUpkeepService.audit(row);
|
||||
break;
|
||||
case "3":
|
||||
// 点检
|
||||
pdaDeviceSportCheckService.audit(row);
|
||||
break;
|
||||
case "4":
|
||||
// 润滑
|
||||
pdaDeviceLubriCateService.audit(row);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
|
||||
package org.nl.wms.device_manage.pda.service.impl;
|
||||
|
||||
|
||||
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.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.device_manage.pda.service.PdaDeviceRepairService;
|
||||
import org.nl.wms.device_manage.repair.service.DevicerepairmstService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务实现
|
||||
* @date 2022-06-22
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class PdaDeviceRepairServiceImpl implements PdaDeviceRepairService {
|
||||
|
||||
@Autowired
|
||||
private DevicerepairmstService devicerepairmstService;
|
||||
|
||||
@Override
|
||||
public JSONObject getAllQuery(JSONObject whereJson) {
|
||||
String device_code = whereJson.getString("device_code");
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_DEVICEREPAIR_01").addParam("flag", "1")
|
||||
.addParam("device_code", ObjectUtil.isNotEmpty(device_code) ? "%" + device_code + "%" : "")
|
||||
.process().getResultJSONArray(0);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("data", resultJSONArray);
|
||||
result.put("message", "查询成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject begin(JSONObject whereJson) {
|
||||
JSONObject row = whereJson.getJSONObject("row");
|
||||
|
||||
// 组织数据
|
||||
row.put("estimaterepair_times", "1"); // 维修时间默认为 1
|
||||
row.put("update_optname", SecurityUtils.getCurrentNickName()); // 维修人
|
||||
|
||||
// 调用维修服务接口
|
||||
devicerepairmstService.startRepair(row);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDtl(JSONObject whereJson) {
|
||||
|
||||
String repair_id = whereJson.getString("repair_id");
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_DEVICEREPAIR_01").addParam("flag", "2")
|
||||
.addParam("repair_id", repair_id).process().getResultJSONArray(0);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("data", resultJSONArray);
|
||||
result.put("message", "查询成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject confirm(JSONObject whereJson) {
|
||||
WQLObject reMstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairMst"); // 设备维修单主表
|
||||
|
||||
// 组织数据
|
||||
JSONObject jsonMst = reMstTab.query("repair_code = '" + whereJson.getString("repair_code") + "'").uniqueResult(0);
|
||||
jsonMst.put("fault_comment", "手持结束");
|
||||
jsonMst.put("fault_cause", "手持结束");
|
||||
jsonMst.put("fault_analysis", "手持结束");
|
||||
jsonMst.put("measure", "手持结束");
|
||||
jsonMst.put("tableData", whereJson.getJSONArray("rows"));
|
||||
devicerepairmstService.endRepair(jsonMst);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void audit(JSONObject whereJson) {
|
||||
WQLObject reMstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairMst"); // 设备维修单主表
|
||||
JSONObject jsonMst = reMstTab.query("repair_code = '" + whereJson.getString("job_code") + "'").uniqueResult(0);
|
||||
devicerepairmstService.uditRepair(jsonMst);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
|
||||
package org.nl.wms.device_manage.pda.service.impl;
|
||||
|
||||
|
||||
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.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.device_manage.pda.service.PdaDeviceSportCheckService;
|
||||
import org.nl.wms.device_manage.sportcheck.service.DevicesportcheckmstService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务实现
|
||||
* @date 2022-06-22
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class PdaDeviceSportCheckServiceImpl implements PdaDeviceSportCheckService {
|
||||
|
||||
@Autowired
|
||||
private DevicesportcheckmstService devicesportcheckmstService;
|
||||
|
||||
@Override
|
||||
public JSONObject getAllQuery(JSONObject whereJson) {
|
||||
String device_code = whereJson.getString("device_code");
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_DEVICESPORTCHECK_01").addParam("flag", "1")
|
||||
.addParam("device_code", ObjectUtil.isNotEmpty(device_code) ? "%" + device_code + "%" : "")
|
||||
.process().getResultJSONArray(0);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("data", resultJSONArray);
|
||||
result.put("message", "查询成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject begin(JSONObject whereJson) {
|
||||
JSONObject row = whereJson.getJSONObject("row");
|
||||
|
||||
// 组织数据
|
||||
row.put("update_optname", SecurityUtils.getCurrentNickName()); // 点检人
|
||||
|
||||
// 调用点检务接口
|
||||
devicesportcheckmstService.startMaintain(row);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDtl(JSONObject whereJson) {
|
||||
|
||||
String maint_id = whereJson.getString("maint_id");
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_DEVICESPORTCHECK_01").addParam("flag", "2")
|
||||
.addParam("maint_id", maint_id).process().getResultJSONArray(0);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("data", resultJSONArray);
|
||||
result.put("message", "查询成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject confirm(JSONObject whereJson) {
|
||||
WQLObject MstTab = WQLObject.getWQLObject("EM_BI_DeviceSportCheckMst"); // 设备点检单主表
|
||||
|
||||
// 组织数据
|
||||
JSONObject jsonMst = MstTab.query("maint_code = '" + whereJson.getString("maint_code") + "'").uniqueResult(0);
|
||||
jsonMst.put("tableData", whereJson.getJSONArray("rows"));
|
||||
|
||||
devicesportcheckmstService.endMaintain(jsonMst);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void audit(JSONObject whereJson) {
|
||||
WQLObject MstTab = WQLObject.getWQLObject("EM_BI_DeviceSportCheckMst"); // 设备点检单主表
|
||||
JSONObject jsonMst = MstTab.query("maint_code = '" + whereJson.getString("job_code") + "'").uniqueResult(0);
|
||||
devicesportcheckmstService.auditMaintain(jsonMst);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
|
||||
package org.nl.wms.device_manage.pda.service.impl;
|
||||
|
||||
|
||||
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.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.device_manage.pda.service.PdaDeviceUpkeepService;
|
||||
import org.nl.wms.device_manage.upkeep.service.DevicemaintenancemstService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务实现
|
||||
* @date 2022-06-22
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class PdaDeviceUpkeepServiceImpl implements PdaDeviceUpkeepService {
|
||||
|
||||
@Autowired
|
||||
private DevicemaintenancemstService devicemaintenancemstService;
|
||||
|
||||
@Override
|
||||
public JSONObject getAllQuery(JSONObject whereJson) {
|
||||
String device_code = whereJson.getString("device_code");
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_DEVICEUPKEEP_01").addParam("flag", "1")
|
||||
.addParam("device_code", ObjectUtil.isNotEmpty(device_code) ? "%" + device_code + "%" : "")
|
||||
.process().getResultJSONArray(0);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("data", resultJSONArray);
|
||||
result.put("message", "查询成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject begin(JSONObject whereJson) {
|
||||
JSONObject row = whereJson.getJSONObject("row");
|
||||
|
||||
// 组织数据
|
||||
row.put("update_optname", SecurityUtils.getCurrentNickName()); // 保养人
|
||||
|
||||
// 调用保养务接口
|
||||
devicemaintenancemstService.startMaintain(row);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDtl(JSONObject whereJson) {
|
||||
|
||||
String maint_id = whereJson.getString("maint_id");
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_DEVICEUPKEEP_01").addParam("flag", "2")
|
||||
.addParam("maint_id", maint_id).process().getResultJSONArray(0);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("data", resultJSONArray);
|
||||
result.put("message", "查询成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject confirm(JSONObject whereJson) {
|
||||
WQLObject MstTab = WQLObject.getWQLObject("EM_BI_DeviceMaintenanceMst"); // 设备保养单主表
|
||||
|
||||
// 组织数据
|
||||
JSONObject jsonMst = MstTab.query("maint_code = '" + whereJson.getString("maint_code") + "'").uniqueResult(0);
|
||||
jsonMst.put("tableData", whereJson.getJSONArray("rows"));
|
||||
|
||||
devicemaintenancemstService.endMaintain(jsonMst);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void audit(JSONObject whereJson) {
|
||||
WQLObject MstTab = WQLObject.getWQLObject("EM_BI_DeviceMaintenanceMst"); // 设备保养单主表
|
||||
JSONObject jsonMst = MstTab.query("maint_code = '" + whereJson.getString("job_code") + "'").uniqueResult(0);
|
||||
devicemaintenancemstService.auditMaintain(jsonMst);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
[交易说明]
|
||||
交易名: 手持润滑单维护查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.device_code TYPEAS s_string
|
||||
输入.maint_id TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
mst.*,
|
||||
file.device_code,
|
||||
file.device_name
|
||||
FROM
|
||||
EM_BI_DeviceLubricateMst mst
|
||||
LEFT JOIN EM_BI_EquipmentFile file ON file.devicerecord_id = mst.devicerecord_id
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
AND file.is_delete = '0'
|
||||
AND mst.invstatus in ('02','03')
|
||||
|
||||
OPTION 输入.device_code <> ""
|
||||
(file.device_code like 输入.device_code or
|
||||
file.device_name like 输入.device_code)
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
dtl.maint_dtl_id,
|
||||
dtl.maint_id,
|
||||
dtl.device_item_id,
|
||||
dtl.isfinish,
|
||||
dtl.dtl_remark,
|
||||
item.*
|
||||
FROM
|
||||
EM_BI_DeviceLubricateDtl dtl
|
||||
LEFT JOIN EM_BI_DeviceLubricateItems item ON item.maint_item_id = dtl.device_item_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.maint_id <> ""
|
||||
dtl.maint_id = 输入.maint_id
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -0,0 +1,276 @@
|
||||
[交易说明]
|
||||
交易名: 手持设备作业查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.device_code TYPEAS s_string
|
||||
输入.job_type TYPEAS s_string
|
||||
输入.job_code TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
(
|
||||
CASE LEFT(mst.repair_code, 3)
|
||||
WHEN 'WXD' THEN '1'
|
||||
WHEN 'BYD' THEN '2'
|
||||
WHEN 'DJD' THEN '3'
|
||||
WHEN 'RHD' THEN '4'
|
||||
END
|
||||
) AS job_type,
|
||||
mst.repair_code AS job_code,
|
||||
file.device_code,
|
||||
file.device_name,
|
||||
mst.invstatus AS status,
|
||||
mst.plan_start_date,
|
||||
mst.real_end_date AS plan_end_date
|
||||
FROM
|
||||
EM_BI_DeviceRepairMst mst
|
||||
LEFT JOIN EM_BI_EquipmentFile file ON file.devicerecord_id = mst.devicerecord_id
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
AND file.is_delete = '0'
|
||||
AND mst.invstatus = '06'
|
||||
|
||||
OPTION 输入.device_code <> ""
|
||||
(file.device_code like 输入.device_code or
|
||||
file.device_name like 输入.device_code)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.job_type <> ""
|
||||
LEFT(mst.repair_code, 3) = 输入.job_type
|
||||
ENDOPTION
|
||||
|
||||
UNION
|
||||
|
||||
SELECT
|
||||
(
|
||||
CASE LEFT(mst.maint_code, 3)
|
||||
WHEN 'WXD' THEN '1'
|
||||
WHEN 'BYD' THEN '2'
|
||||
WHEN 'DJD' THEN '3'
|
||||
WHEN 'RHD' THEN '4'
|
||||
END
|
||||
) AS job_type,
|
||||
mst.maint_code AS job_code,
|
||||
file.device_code,
|
||||
file.device_name,
|
||||
mst.invstatus AS status,
|
||||
mst.plan_start_date,
|
||||
mst.real_end_date AS plan_end_date
|
||||
FROM
|
||||
EM_BI_DeviceMaintenanceMst mst
|
||||
LEFT JOIN EM_BI_EquipmentFile file ON file.devicerecord_id = mst.devicerecord_id
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
AND file.is_delete = '0'
|
||||
AND mst.invstatus = '04'
|
||||
|
||||
OPTION 输入.device_code <> ""
|
||||
(file.device_code like 输入.device_code or
|
||||
file.device_name like 输入.device_code)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.job_type <> ""
|
||||
LEFT(mst.maint_code, 3) = 输入.job_type
|
||||
ENDOPTION
|
||||
|
||||
UNION
|
||||
|
||||
SELECT
|
||||
(
|
||||
CASE LEFT(mst.maint_code, 3)
|
||||
WHEN 'WXD' THEN '1'
|
||||
WHEN 'BYD' THEN '2'
|
||||
WHEN 'DJD' THEN '3'
|
||||
WHEN 'RHD' THEN '4'
|
||||
END
|
||||
) AS job_type,
|
||||
mst.maint_code AS job_code,
|
||||
file.device_code,
|
||||
file.device_name,
|
||||
mst.invstatus AS status,
|
||||
mst.plan_start_date,
|
||||
mst.real_end_date AS plan_end_date
|
||||
FROM
|
||||
EM_BI_DeviceSportCheckMst mst
|
||||
LEFT JOIN EM_BI_EquipmentFile file ON file.devicerecord_id = mst.devicerecord_id
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
AND file.is_delete = '0'
|
||||
AND mst.invstatus = '04'
|
||||
|
||||
OPTION 输入.device_code <> ""
|
||||
(file.device_code like 输入.device_code or
|
||||
file.device_name like 输入.device_code)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.job_type <> ""
|
||||
LEFT(mst.maint_code, 3) = 输入.job_type
|
||||
ENDOPTION
|
||||
|
||||
UNION
|
||||
|
||||
SELECT
|
||||
(
|
||||
CASE LEFT(mst.maint_code, 3)
|
||||
WHEN 'WXD' THEN '1'
|
||||
WHEN 'BYD' THEN '2'
|
||||
WHEN 'DJD' THEN '3'
|
||||
WHEN 'RHD' THEN '4'
|
||||
END
|
||||
) AS job_type,
|
||||
mst.maint_code AS job_code,
|
||||
file.device_code,
|
||||
file.device_name,
|
||||
mst.invstatus AS status,
|
||||
mst.plan_start_date,
|
||||
mst.real_end_date AS plan_end_date
|
||||
FROM
|
||||
EM_BI_DeviceLubricateMst mst
|
||||
LEFT JOIN EM_BI_EquipmentFile file ON file.devicerecord_id = mst.devicerecord_id
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
AND file.is_delete = '0'
|
||||
AND mst.invstatus = '04'
|
||||
|
||||
OPTION 输入.device_code <> ""
|
||||
(file.device_code like 输入.device_code or
|
||||
file.device_name like 输入.device_code)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.job_type <> ""
|
||||
LEFT(mst.maint_code, 3) = 输入.job_type
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
dtl.isfinish,
|
||||
item.repair_item_code AS item_code,
|
||||
item.repair_item_name AS item_name,
|
||||
item.requirement
|
||||
FROM
|
||||
EM_BI_DeviceRepairDtl dtl
|
||||
LEFT JOIN EM_BI_DeviceRepairMst mst ON dtl.repair_id = mst.repair_id
|
||||
LEFT JOIN EM_BI_DeviceRepairItems item ON item.repair_item_id = dtl.repair_item_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.job_code <> ""
|
||||
mst.repair_code = 输入.job_code
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
QUERY
|
||||
SELECT
|
||||
dtl.isfinish,
|
||||
item.maint_item_code AS item_code,
|
||||
item.maint_item_name AS item_name,
|
||||
item.item_level,
|
||||
item.contents,
|
||||
item.requirement
|
||||
FROM
|
||||
EM_BI_DeviceMaintenanceDtl dtl
|
||||
LEFT JOIN EM_BI_DeviceMaintenanceMst mst ON dtl.maint_id = mst.maint_id
|
||||
LEFT JOIN EM_BI_DeviceMaintenanceItems item ON item.maint_item_id = dtl.device_item_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.job_code <> ""
|
||||
mst.maint_code = 输入.job_code
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "4"
|
||||
QUERY
|
||||
SELECT
|
||||
dtl.isfinish,
|
||||
item.maint_item_code AS item_code,
|
||||
item.maint_item_name AS item_name,
|
||||
item.item_level,
|
||||
item.contents,
|
||||
item.requirement
|
||||
FROM
|
||||
EM_BI_DeviceSportCheckDtl dtl
|
||||
LEFT JOIN EM_BI_DeviceSportCheckMst mst ON dtl.maint_id = mst.maint_id
|
||||
LEFT JOIN EM_BI_DeviceSportCheckItems item ON item.maint_item_id = dtl.device_item_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.job_code <> ""
|
||||
mst.maint_code = 输入.job_code
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "5"
|
||||
QUERY
|
||||
SELECT
|
||||
dtl.isfinish,
|
||||
item.maint_item_code AS item_code,
|
||||
item.maint_item_name AS item_name,
|
||||
item.item_level,
|
||||
item.contents,
|
||||
item.requirement
|
||||
FROM
|
||||
EM_BI_DeviceLubricateDtl dtl
|
||||
LEFT JOIN EM_BI_DeviceLubricateMst mst ON dtl.maint_id = mst.maint_id
|
||||
LEFT JOIN EM_BI_DeviceLubricateItems item ON item.maint_item_id = dtl.device_item_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.job_code <> ""
|
||||
mst.maint_code = 输入.job_code
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -0,0 +1,86 @@
|
||||
[交易说明]
|
||||
交易名: 手持维修单维护查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.device_code TYPEAS s_string
|
||||
输入.repair_id TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
mst.*,
|
||||
file.device_code,
|
||||
file.device_name
|
||||
FROM
|
||||
EM_BI_DeviceRepairMst mst
|
||||
LEFT JOIN EM_BI_EquipmentFile file ON file.devicerecord_id = mst.devicerecord_id
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
AND file.is_delete = '0'
|
||||
AND mst.invstatus in ('02','03')
|
||||
|
||||
OPTION 输入.device_code <> ""
|
||||
(file.device_code like 输入.device_code or
|
||||
file.device_name like 输入.device_code)
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
dtl.repair_dtl_id,
|
||||
dtl.repair_id,
|
||||
dtl.dtl_remark,
|
||||
dtl.isfinish,
|
||||
item.*
|
||||
FROM
|
||||
EM_BI_DeviceRepairDtl dtl
|
||||
LEFT JOIN EM_BI_DeviceRepairItems item ON item.repair_item_id = dtl.repair_item_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.repair_id <> ""
|
||||
dtl.repair_id = 输入.repair_id
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -0,0 +1,87 @@
|
||||
[交易说明]
|
||||
交易名: 手持点检单维护查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.device_code TYPEAS s_string
|
||||
输入.maint_id TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
mst.*,
|
||||
file.device_code,
|
||||
file.device_name
|
||||
FROM
|
||||
EM_BI_DeviceSportCheckMst mst
|
||||
LEFT JOIN EM_BI_EquipmentFile file ON file.devicerecord_id = mst.devicerecord_id
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
AND file.is_delete = '0'
|
||||
AND mst.invstatus in ('02','03')
|
||||
|
||||
OPTION 输入.device_code <> ""
|
||||
(file.device_code like 输入.device_code or
|
||||
file.device_name like 输入.device_code)
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
dtl.maint_dtl_id,
|
||||
dtl.maint_id,
|
||||
dtl.device_item_id,
|
||||
dtl.isfinish,
|
||||
dtl.dtl_remark,
|
||||
item.*
|
||||
FROM
|
||||
EM_BI_DeviceSportCheckDtl dtl
|
||||
LEFT JOIN EM_BI_DeviceSportCheckItems item ON item.maint_item_id = dtl.device_item_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.maint_id <> ""
|
||||
dtl.maint_id = 输入.maint_id
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -0,0 +1,87 @@
|
||||
[交易说明]
|
||||
交易名: 手持保养单维护查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.device_code TYPEAS s_string
|
||||
输入.maint_id TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
mst.*,
|
||||
file.device_code,
|
||||
file.device_name
|
||||
FROM
|
||||
EM_BI_DeviceMaintenanceMst mst
|
||||
LEFT JOIN EM_BI_EquipmentFile file ON file.devicerecord_id = mst.devicerecord_id
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
AND file.is_delete = '0'
|
||||
AND mst.invstatus in ('02','03')
|
||||
|
||||
OPTION 输入.device_code <> ""
|
||||
(file.device_code like 输入.device_code or
|
||||
file.device_name like 输入.device_code)
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
dtl.maint_dtl_id,
|
||||
dtl.maint_id,
|
||||
dtl.device_item_id,
|
||||
dtl.isfinish,
|
||||
dtl.dtl_remark,
|
||||
item.*
|
||||
FROM
|
||||
EM_BI_DeviceMaintenanceDtl dtl
|
||||
LEFT JOIN EM_BI_DeviceMaintenanceItems item ON item.maint_item_id = dtl.device_item_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.maint_id <> ""
|
||||
dtl.maint_id = 输入.maint_id
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
Reference in New Issue
Block a user