修改
This commit is contained in:
@@ -8,6 +8,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.annotation.Log;
|
||||
import org.nl.pda.sb.service.SparePartService;
|
||||
import org.nl.wql.core.content.HttpContext;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -169,4 +170,21 @@ public class SparePartController {
|
||||
public ResponseEntity<Object> save(@RequestBody Map whereJson) {
|
||||
return new ResponseEntity<>(sparePartService.save(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/deptList")
|
||||
@Log("部门下拉框")
|
||||
@ApiOperation("部门下拉框")
|
||||
public ResponseEntity<Object> deptList(@RequestBody Map whereJson) {
|
||||
return new ResponseEntity<>(sparePartService.deptList(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/repairRequest")
|
||||
@Log("查询报修单")
|
||||
@ApiOperation("查询报修单")
|
||||
public ResponseEntity<Object> repairRequest(@RequestBody Map whereJson) {
|
||||
HttpContext ctx = new HttpContext("11");
|
||||
ctx.setPage((String)(whereJson.get("page")));
|
||||
ctx.setRows((String)(whereJson.get("size")));
|
||||
return new ResponseEntity<>(sparePartService.repairRequest(whereJson,ctx),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.pda.sb.service;
|
||||
|
||||
import org.nl.wql.core.content.HttpContext;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -51,5 +52,9 @@ public interface SparePartService {
|
||||
|
||||
Map<String, Object> save(Map jsonObject);
|
||||
|
||||
Map<String, Object> deptList(Map jsonObject);
|
||||
|
||||
Map<String, Object> repairRequest(Map jsonObject, HttpContext ctx);
|
||||
|
||||
Map<String, Object> repairs(Map map, HttpServletRequest request);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.nl.wms.sb.repair.service.DevicerepairmstService;
|
||||
import org.nl.wms.sb.upkeep.service.DevicemaintenancemstService;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.nl.wql.core.content.HttpContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -72,8 +73,8 @@ public class SparePartServiceImpl implements SparePartService {
|
||||
String device_id = spare_bom.getString("devicerecord_id");*/
|
||||
|
||||
//查询是否已经入库
|
||||
JSONObject ivt = WQLObject.getWQLObject("em_bi_devicesparepartivt").query("sparepart_only_id = '"+sparepart_only_id+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(ivt)){
|
||||
JSONObject ivt = WQLObject.getWQLObject("em_bi_devicesparepartivt").query("sparepart_only_id = '" + sparepart_only_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(ivt)) {
|
||||
throw new PdaRequestException("该备件已经入库!");
|
||||
}
|
||||
JSONObject row = WQL.getWO("QPDAEM_BI_SPAREPART").addParam("flag", "1").addParam("sparepart_only_id", sparepart_only_id).process().uniqueResult(0);
|
||||
@@ -889,6 +890,33 @@ public class SparePartServiceImpl implements SparePartService {
|
||||
return returnjo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> deptList(Map jsonObject) {
|
||||
JSONArray rows = WQL.getWO("QPDAEM_BI_SPAREPART").addParam("flag", "9").process().getResultJSONArray(0);
|
||||
JSONObject returnjo = new JSONObject();
|
||||
returnjo.put("code", "1");
|
||||
returnjo.put("desc", "操作成功!");
|
||||
returnjo.put("rows", rows);
|
||||
return returnjo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> repairRequest(Map jsonObject, HttpContext ctx) {
|
||||
if (ObjectUtil.isEmpty(jsonObject)) {
|
||||
throw new PdaRequestException("传入参数不能为空!");
|
||||
}
|
||||
JSONObject form = JSONObject.parseObject(JSON.toJSONString(jsonObject));
|
||||
String dept_id = form.getString("dept_id");
|
||||
|
||||
JSONObject jo1 = WQL.getWO("QPDAEM_BI_SPAREPART").addParam("flag", "10").addParam("dept_id", dept_id).pageQuery(ctx,"create_time desc");
|
||||
JSONObject returnjo = new JSONObject();
|
||||
returnjo.put("code", "1");
|
||||
returnjo.put("desc", "查询成功!");
|
||||
returnjo.put("rows", jo1.getJSONArray("content"));
|
||||
returnjo.put("size", jo1.getJSONArray("content").size());
|
||||
return returnjo;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public Map<String, Object> repairs(Map map, HttpServletRequest request) {
|
||||
|
||||
@@ -307,6 +307,17 @@
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "9"
|
||||
QUERY
|
||||
SELECT
|
||||
dept_id AS value,
|
||||
`name` AS label
|
||||
FROM
|
||||
sys_dept
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user