opt: 任务。任务配置
This commit is contained in:
@@ -107,14 +107,10 @@ public class Searcher {
|
||||
|
||||
for (ScoreDoc scoreDoc : scoreDocs) {
|
||||
Document doc = reader.document(scoreDoc.doc);
|
||||
String logInfo = LogMessageConstant.COLOR_CYAN + doc.get(LogMessageConstant.FIELD_LABEL) +
|
||||
String logInfo = LogMessageConstant.COLOR_RED + doc.get(LogMessageConstant.FIELD_TIMESTAMP) +
|
||||
LogMessageConstant.COLOR_RESET + " - " +
|
||||
LogMessageConstant.COLOR_BLUE + doc.get(LogMessageConstant.FIELD_IP) +
|
||||
LogMessageConstant.COLOR_RESET + " - " +
|
||||
LogMessageConstant.COLOR_YELLOW + doc.get(LogMessageConstant.FIELD_TRACEID) +
|
||||
LogMessageConstant.COLOR_RESET + " - " +
|
||||
LogMessageConstant.COLOR_RED + doc.get(LogMessageConstant.FIELD_TIMESTAMP) +
|
||||
LogMessageConstant.COLOR_RESET + " - " +
|
||||
LogMessageConstant.COLOR_GREEN + "[" + doc.get(LogMessageConstant.FIELD_THREAD) + "]" +
|
||||
LogMessageConstant.COLOR_RESET + " - " +
|
||||
LogMessageConstant.COLOR_BLACK + doc.get(LogMessageConstant.FIELD_LEVEL) +
|
||||
|
||||
@@ -38,6 +38,6 @@ public class LuceneController {
|
||||
@PostMapping("/deleteAllLog")
|
||||
public ResponseEntity<Object> deleteAllLog() {
|
||||
luceneService.deleteAllLog();
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,10 @@ public class LuceneServiceImpl implements LuceneService {
|
||||
IndexWriter writer = LuceneAppender.indexWriter;
|
||||
// 创建一个匹配所有文档的查询
|
||||
MatchAllDocsQuery query = new MatchAllDocsQuery();
|
||||
writer.deleteDocuments(query);
|
||||
// 获取删除的文档数量
|
||||
long deletedDocs = writer.deleteDocuments(query);
|
||||
// 输出删除的文档数量
|
||||
System.out.println("Deleted " + deletedDocs + " documents");
|
||||
writer.commit();
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,8 @@ public class SysParamServiceImpl extends ServiceImpl<SysParamMapper, Param> impl
|
||||
IPage<Param> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
LambdaQueryWrapper<Param> lam = new QueryWrapper<Param>().lambda();
|
||||
lam.like(ObjectUtil.isNotEmpty(code), Param::getCode, code)
|
||||
.or(ObjectUtil.isNotEmpty(code))
|
||||
.like(ObjectUtil.isNotEmpty(code), Param::getName, code)
|
||||
.orderByAsc(Param::getCreate_time);
|
||||
paramMapper.selectPage(pages, lam);
|
||||
return pages;
|
||||
|
||||
@@ -430,13 +430,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
String getStation = request.getGet_station();
|
||||
String putStation = request.getPut_station();
|
||||
// 查找当前点位中的信息,如果acs没有提供,就获取点位上的数据,如果点位没有,则数据失效
|
||||
// 拆垛位
|
||||
SchBasePoint pickupPoint = pointService.getById(getStation);
|
||||
// 码垛位
|
||||
SchBasePoint putPoint = pointService.getById(putStation);
|
||||
if (request.getGet_station_vehicle_code() == null || request.getGet_station_vehicle_code().equals("0")) {
|
||||
request.setGet_station_vehicle_code(pickupPoint.getVehicle_code());
|
||||
if (request.getGet_station_vehicle_code() == null || "0".equals(request.getGet_station_vehicle_code())) {
|
||||
throw new BadRequestException("取砖位的载具编码不能为空");
|
||||
}
|
||||
if (request.getPut_station_vehicle_code() == null || request.getPut_station_vehicle_code().equals("0")) {
|
||||
request.setPut_station_vehicle_code(putPoint.getVehicle_code());
|
||||
if (request.getPut_station_vehicle_code() == null || "0".equals(request.getPut_station_vehicle_code())) {
|
||||
throw new BadRequestException("放置位的载具编码不能为空");
|
||||
}
|
||||
// 获取工单
|
||||
PdmBdWorkorder productionTask = workorderService.getDeviceProductionTask(pickupPoint.getParent_point_code());
|
||||
@@ -703,7 +705,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
taskResponse.setMessage("静置完成");
|
||||
taskResponse.setWeight(one.getMaterial_weight().toString());
|
||||
taskResponse.setMudBatch(one.getPcsn());
|
||||
// todo: 泥料数据删除
|
||||
// 泥料数据删除
|
||||
List<PdmBdRequestMaterialRecord> list = requestMaterialRecordService.list(new LambdaQueryWrapper<PdmBdRequestMaterialRecord>()
|
||||
.eq(PdmBdRequestMaterialRecord::getDevice_code, yjDeviceCode)
|
||||
.eq(ObjectUtil.isNotEmpty(productionTask), PdmBdRequestMaterialRecord::getWorkorder_id, productionTask.getWorkorder_code())
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.pda.controller;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.annotation.Limit;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.das.device.check.service.IDasDeviceCheckRecordService;
|
||||
import org.nl.wms.das.device.check.service.dao.DasDeviceCheckRecord;
|
||||
@@ -44,56 +45,48 @@ public class PdaController {
|
||||
|
||||
@PostMapping("/deviceCheck/verify")
|
||||
@Log("设备点检")
|
||||
|
||||
public ResponseEntity<Object> deviceCheck(@Validated @RequestBody DasDeviceCheckRecord entity) {
|
||||
return new ResponseEntity<>(deviceCheckRecordService.create(entity), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/deviceCheck/deviceInfo")
|
||||
@Log("设备下拉框数据")
|
||||
|
||||
public ResponseEntity<Object> deviceInfo() {
|
||||
return new ResponseEntity<>(pdaService.getDeviceInfo(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/deviceCheck/deviceStatus")
|
||||
@Log("设备状态下拉框数据")
|
||||
|
||||
public ResponseEntity<Object> deviceStatus() {
|
||||
return new ResponseEntity<>(pdaService.getDeviceStatus(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/deviceSwitchover/deviceAction")
|
||||
@Log("设备动作下拉框数据")
|
||||
|
||||
public ResponseEntity<Object> deviceAction() {
|
||||
return new ResponseEntity<>(pdaService.deviceAction(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/deviceSwitchover/verify")
|
||||
@Log("设备动作切换")
|
||||
|
||||
public ResponseEntity<Object> deviceSwitchover(@Validated @RequestBody DasDeviceOperationRecord entity) {
|
||||
return new ResponseEntity<>(deviceOperationRecordService.create(entity), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/group/getPressCode")
|
||||
@Log("获取压机编码")
|
||||
|
||||
public ResponseEntity<Object> getPressCode() {
|
||||
return new ResponseEntity<>(pdaService.getDeviceInfo(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/group/getVehicleType")
|
||||
@Log("获取载具类型")
|
||||
|
||||
public ResponseEntity<Object> getVehicleType() {
|
||||
return new ResponseEntity<>(pdaService.getVehicleType(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/group/getPressWorkOrder")
|
||||
@Log("获取工单编码")
|
||||
|
||||
@Deprecated
|
||||
public ResponseEntity<Object> getPressWorkOrder(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(workorderService.getDeviceProductionTask(param.getString("point_code")), HttpStatus.OK);
|
||||
@@ -101,56 +94,48 @@ public class PdaController {
|
||||
|
||||
@PostMapping("/group/manual")
|
||||
@Log("人工组盘")
|
||||
|
||||
public ResponseEntity<PdaResponseVo> manualDiskAssembly(@Validated @RequestBody ManualGroupDto entity) {
|
||||
return new ResponseEntity<>(pdaService.manualCreateByPda(entity), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/move/getBlendingCode")
|
||||
@Log("获取混碾机编码")
|
||||
|
||||
public ResponseEntity<Object> getBlendingCode() {
|
||||
return new ResponseEntity<>(pdaService.getBlendingCode(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/move/sendTask")
|
||||
@Log("生成混碾->压机任务")
|
||||
|
||||
public ResponseEntity<PdaResponseVo> sendTask(@Validated @RequestBody BlendingMoveDto blendingMoveDto) {
|
||||
return new ResponseEntity<>(pdaService.sendTask(blendingMoveDto), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/forcedResting/show")
|
||||
@Log("显示静置时长")
|
||||
|
||||
public ResponseEntity<Object> forcedRestingShow() {
|
||||
return new ResponseEntity<>(pdaService.forcedRestingShow(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/forcedResting/submit")
|
||||
@Log("强制静置")
|
||||
|
||||
public ResponseEntity<PdaResponseVo> forcedResting(@Validated @RequestBody ForcedRestingDto forcedRestingDto) {
|
||||
return new ResponseEntity<>(pdaService.forcedResting(forcedRestingDto), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/orders")
|
||||
@Log("人工分拣-显示工单")
|
||||
|
||||
public ResponseEntity<Object> manualOrders() {
|
||||
return new ResponseEntity<>(pdaService.manualOrders(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/productionScheduling")
|
||||
@Log("人工分拣-开工")
|
||||
|
||||
public ResponseEntity<PdaResponseVo> productionScheduling(@Validated @RequestBody ManualSortingDto manualSortingDto) {
|
||||
return new ResponseEntity<>(pdaService.productionScheduling(manualSortingDto), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/productionComplete")
|
||||
@Log("人工分拣-完工")
|
||||
|
||||
public ResponseEntity<PdaResponseVo> productionComplete(@Validated @RequestBody ManualSortingDto manualSortingDto) {
|
||||
return new ResponseEntity<>(pdaService.productionComplete(manualSortingDto), HttpStatus.OK);
|
||||
}
|
||||
@@ -227,7 +212,7 @@ public class PdaController {
|
||||
|
||||
@PostMapping("/manualSorting/bindingVehicle")
|
||||
@Log("人工分拣-载具绑定")
|
||||
|
||||
@Limit(period = 2, count = 1)
|
||||
public ResponseEntity<PdaResponseVo> bindingVehicle(@Validated @RequestBody VehicleBindingDto vehicleBindingDto) {
|
||||
return new ResponseEntity<>(pdaService.bindingVehicle(vehicleBindingDto), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task.service.dto.SchBaseTaskQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -33,13 +34,12 @@ public class SchBaseTaskController {
|
||||
@Log("查询任务管理")
|
||||
|
||||
//@SaCheckPermission("@el.check('schBaseTask:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
public ResponseEntity<Object> query(SchBaseTaskQuery whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(schBaseTaskService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增任务管理")
|
||||
|
||||
//@SaCheckPermission("@el.check('schBaseTask:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody SchBaseTask entity) {
|
||||
schBaseTaskService.create(entity);
|
||||
@@ -48,7 +48,6 @@ public class SchBaseTaskController {
|
||||
|
||||
@PutMapping
|
||||
@Log("修改任务管理")
|
||||
|
||||
//@SaCheckPermission("@el.check('schBaseTask:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody SchBaseTask entity) {
|
||||
schBaseTaskService.update(entity);
|
||||
@@ -66,7 +65,6 @@ public class SchBaseTaskController {
|
||||
|
||||
@GetMapping("/taskStatusList")
|
||||
@Log("任务状态下拉框")
|
||||
|
||||
@SaIgnore
|
||||
//@SaCheckPermission("@el.check('schBaseTask:list')")
|
||||
public ResponseEntity<Object> getTaskStatusList() {
|
||||
@@ -75,7 +73,6 @@ public class SchBaseTaskController {
|
||||
|
||||
@PutMapping("/operation")
|
||||
@Log("任务操作")
|
||||
|
||||
//@SaCheckPermission("task:edit")
|
||||
public ResponseEntity<Object> update(@RequestBody Map<String, Object> map) {
|
||||
schBaseTaskService.operation(map);
|
||||
|
||||
@@ -63,4 +63,10 @@ public class SchBaseTaskconfigController {
|
||||
schBaseTaskconfigService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getTaskConfigList")
|
||||
@Log("获取下拉框")
|
||||
public ResponseEntity<Object> getTaskConfigList() {
|
||||
return new ResponseEntity<>(schBaseTaskconfigService.getTaskConfigList(), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.ext.acs.service.dto.to.BaseRequest;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
||||
import org.nl.wms.sch.task.service.dto.SchBaseTaskQuery;
|
||||
import org.nl.wms.sch.task_manage.task.core.TaskStatus;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -28,7 +30,7 @@ public interface ISchBaseTaskService extends IService<SchBaseTask> {
|
||||
* @param pageable 分页参数
|
||||
* @return IPage<SchBaseTask>
|
||||
*/
|
||||
IPage<SchBaseTask> queryAll(Map whereJson, PageQuery pageable);
|
||||
IPage<SchBaseTask> queryAll(SchBaseTaskQuery whereJson, PageQuery pageable);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -44,4 +45,6 @@ public interface ISchBaseTaskconfigService extends IService<SchBaseTaskconfig> {
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Set<String> ids);
|
||||
|
||||
List<SchBaseTaskconfig> getTaskConfigList();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.sch.task.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@@ -117,5 +118,9 @@ public class SchBaseTask implements Serializable {
|
||||
|
||||
|
||||
private String update_time;
|
||||
@TableField(exist = false)
|
||||
private String config_name;
|
||||
@TableField(exist = false)
|
||||
private String task_name;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package org.nl.wms.sch.task.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task.service.dto.SchBaseTaskQuery;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lyd
|
||||
@@ -16,4 +19,6 @@ public interface SchBaseTaskMapper extends BaseMapper<SchBaseTask> {
|
||||
BigDecimal getCallMaterialCarryingByDevice(String deviceCode);
|
||||
|
||||
int getCarryingByDevice(String deviceCode, String taskConfig);
|
||||
|
||||
IPage<SchBaseTask> selectPageLeftJoin(IPage<SchBaseTask> pages, SchBaseTaskQuery whereJson, List<String> collect);
|
||||
}
|
||||
|
||||
@@ -33,4 +33,40 @@
|
||||
AND t.task_status IN ('1', '2', '3', '4')
|
||||
AND p1.parent_point_code = p2.parent_point_code
|
||||
</select>
|
||||
<select id="selectPageLeftJoin" resultType="org.nl.wms.sch.task.service.dao.SchBaseTask">
|
||||
SELECT
|
||||
t.*,
|
||||
tc.config_name,
|
||||
tc.task_name
|
||||
FROM
|
||||
`sch_base_task` t
|
||||
LEFT JOIN sch_base_taskconfig tc ON tc.config_code = t.config_code
|
||||
<where>
|
||||
<if test="whereJson.task_code != null">
|
||||
AND t.task_code = #{whereJson.task_code}
|
||||
</if>
|
||||
<if test="whereJson.config_code != null">
|
||||
AND t.config_code = #{whereJson.config_code}
|
||||
</if>
|
||||
<if test="whereJson.unFinished != null">
|
||||
AND t.task_status <![CDATA[<=]]> #{whereJson.unFinished}
|
||||
</if>
|
||||
<if test="whereJson.vehicle_code != null">
|
||||
AND t.vehicle_code = #{whereJson.vehicle_code}
|
||||
</if>
|
||||
<if test="whereJson.end_time != null">
|
||||
AND t.create_time <![CDATA[<=]]> #{query.end_time}
|
||||
</if>
|
||||
<if test="whereJson.begin_time != null">
|
||||
AND t.create_time <![CDATA[>=]]> #{query.begin_time}
|
||||
</if>
|
||||
<if test="collect != null and collect != ''">
|
||||
AND t.task_status IN
|
||||
<foreach collection="collect" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY t.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
package org.nl.wms.sch.task.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
public class SchBaseTaskQuery extends BaseQuery<SchBaseTask> {
|
||||
@Data
|
||||
public class SchBaseTaskQuery implements Serializable {
|
||||
private String task_code;
|
||||
private String vehicle_code;
|
||||
private String point_code;
|
||||
private String begin_time;
|
||||
private String end_time;
|
||||
private String more_task_status;
|
||||
private String unFinished;
|
||||
|
||||
private String config_code;
|
||||
|
||||
}
|
||||
|
||||
@@ -17,8 +17,10 @@ import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
||||
import org.nl.wms.sch.task.service.dao.mapper.SchBaseTaskMapper;
|
||||
import org.nl.wms.sch.task.service.dao.mapper.SchBaseTaskconfigMapper;
|
||||
import org.nl.wms.sch.task.service.dto.SchBaseTaskQuery;
|
||||
import org.nl.wms.sch.task_manage.AbstractTask;
|
||||
import org.nl.wms.sch.task_manage.task.TaskFactory;
|
||||
import org.nl.wms.sch.task_manage.task.core.TaskStatus;
|
||||
@@ -50,39 +52,17 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
private TaskFactory taskFactory;
|
||||
|
||||
@Override
|
||||
public IPage<SchBaseTask> queryAll(Map whereJson, PageQuery page) {
|
||||
String task_code = ObjectUtil.isNotEmpty(whereJson.get("task_code"))
|
||||
? whereJson.get("task_code").toString() : null;
|
||||
String vehicle_code = ObjectUtil.isNotEmpty(whereJson.get("vehicle_code"))
|
||||
? whereJson.get("vehicle_code").toString() : null;
|
||||
String point_code = ObjectUtil.isNotEmpty(whereJson.get("point_code"))
|
||||
? whereJson.get("point_code").toString() : null;
|
||||
String begin_time = ObjectUtil.isNotEmpty(whereJson.get("begin_time"))
|
||||
? whereJson.get("begin_time").toString() : null;
|
||||
String end_time = ObjectUtil.isNotEmpty(whereJson.get("end_time"))
|
||||
? whereJson.get("end_time").toString() : null;
|
||||
String more_task_status = ObjectUtil.isNotEmpty(whereJson.get("more_task_status"))
|
||||
? whereJson.get("more_task_status").toString() : null;
|
||||
List<String> collect = ObjectUtil.isNotEmpty(more_task_status)
|
||||
? Arrays.stream(more_task_status.split(",")).collect(Collectors.toList()) : null;
|
||||
String unFinished = null;
|
||||
public IPage<SchBaseTask> queryAll(SchBaseTaskQuery whereJson, PageQuery page) {
|
||||
List<String> collect = ObjectUtil.isNotEmpty(whereJson.getMore_task_status())
|
||||
? Arrays.stream(whereJson.getMore_task_status().split(",")).collect(Collectors.toList()) : null;
|
||||
if (collect != null) {
|
||||
if (collect.contains(TaskStatus.UNFINISHED.getCode())) {
|
||||
collect = null;
|
||||
unFinished = TaskStatus.EXECUTING.getCode();
|
||||
whereJson.setUnFinished(TaskStatus.EXECUTING.getCode());
|
||||
}
|
||||
}
|
||||
LambdaQueryWrapper<SchBaseTask> lam = new LambdaQueryWrapper<>();
|
||||
lam.eq(ObjectUtil.isNotEmpty(task_code), SchBaseTask::getTask_code, task_code)
|
||||
.eq(ObjectUtil.isNotEmpty(vehicle_code), SchBaseTask::getVehicle_code, vehicle_code)
|
||||
.eq(ObjectUtil.isNotEmpty(point_code), SchBaseTask::getPoint_code1, point_code)
|
||||
.ge(ObjectUtil.isNotEmpty(begin_time), SchBaseTask::getCreate_time, begin_time)
|
||||
.le(ObjectUtil.isNotEmpty(end_time), SchBaseTask::getCreate_time, end_time)
|
||||
.in(ObjectUtil.isNotEmpty(collect), SchBaseTask::getTask_status, collect)
|
||||
.le(ObjectUtil.isNotEmpty(unFinished), SchBaseTask::getTask_status, unFinished)
|
||||
.orderByDesc(SchBaseTask::getUpdate_time);
|
||||
IPage<SchBaseTask> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
schBaseTaskMapper.selectPage(pages, lam);
|
||||
pages = schBaseTaskMapper.selectPageLeftJoin(pages, whereJson, collect);
|
||||
return pages;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* @author lyd
|
||||
@@ -39,6 +41,7 @@ public class SchBaseTaskconfigServiceImpl extends ServiceImpl<SchBaseTaskconfigM
|
||||
String workshop_code = ObjectUtil.isNotEmpty(whereJson.get("workshop_code")) ? whereJson.get("workshop_code").toString() : null;
|
||||
LambdaQueryWrapper<SchBaseTaskconfig> lam = new LambdaQueryWrapper<>();
|
||||
lam.like(ObjectUtil.isNotEmpty(blurry), SchBaseTaskconfig::getConfig_name, blurry)
|
||||
.or(ObjectUtil.isNotEmpty(blurry), la -> la.like( SchBaseTaskconfig::getConfig_code, blurry))
|
||||
.eq(ObjectUtil.isNotEmpty(workshop_code), SchBaseTaskconfig::getWorkshop_code, workshop_code);
|
||||
IPage<SchBaseTaskconfig> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
schBaseTaskconfigMapper.selectPage(pages, lam);
|
||||
@@ -127,4 +130,9 @@ public class SchBaseTaskconfigServiceImpl extends ServiceImpl<SchBaseTaskconfigM
|
||||
schBaseTaskconfigMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SchBaseTaskconfig> getTaskConfigList() {
|
||||
return this.list();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -144,6 +144,10 @@ export default {
|
||||
toDeleteLog() {
|
||||
luceneOperation.deleteAllLog().then(res => {
|
||||
this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}).finally(() => {
|
||||
this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
getTagList() {
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="参数编码">
|
||||
<el-form-item label="模糊查询">
|
||||
<el-input
|
||||
v-model="query.code"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
placeholder="参数编码"
|
||||
placeholder="编码/名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
|
||||
@@ -7,6 +7,12 @@ export function add(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getTaskConfigList() {
|
||||
return request({
|
||||
url: 'api/schBaseTaskconfig/getTaskConfigList',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
@@ -24,4 +30,4 @@ export function edit(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
export default { add, edit, del, getTaskConfigList }
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<el-input
|
||||
v-model="query.task_code"
|
||||
clearable
|
||||
style="width: 180px"
|
||||
style="width: 240px"
|
||||
placeholder="任务号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
@@ -25,16 +25,29 @@
|
||||
<el-input
|
||||
v-model="query.vehicle_code"
|
||||
clearable
|
||||
style="width: 180px"
|
||||
style="width: 240px"
|
||||
placeholder="载具号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务名称">
|
||||
<label slot="label">任务名称:</label>
|
||||
<el-select v-model="query.config_code" placeholder="请选择" style="width: 240px" @change="crud.toQuery" clearable>
|
||||
<el-option
|
||||
v-for="item in taskConfigList"
|
||||
:key="item.config_id"
|
||||
:label="item.task_name"
|
||||
:value="item.config_code">
|
||||
<span style="float: left">{{ item.config_code }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.task_name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="点位编码">
|
||||
<el-input
|
||||
v-model="query.point_code"
|
||||
clearable
|
||||
style="width: 180px"
|
||||
style="width: 240px"
|
||||
placeholder="起点"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
@@ -179,6 +192,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="提示信息" :min-width="flexWidth('remark',crud.data,'提示信息')" />
|
||||
<el-table-column prop="config_code" label="配置编码" :min-width="flexWidth('config_code',crud.data,'配置编码')" />
|
||||
<el-table-column prop="task_name" label="配置名称" :min-width="flexWidth('task_name',crud.data,'任务名称')" />
|
||||
<el-table-column prop="point_code1" label="起点1" :min-width="flexWidth('point_code1',crud.data,'点位1')" />
|
||||
<el-table-column prop="point_code2" label="终点1" :min-width="flexWidth('point_code2',crud.data,'点位2')" />
|
||||
<el-table-column prop="point_code3" label="起点2" :min-width="flexWidth('point_code3',crud.data,'点位3')" />
|
||||
@@ -244,6 +258,7 @@
|
||||
|
||||
<script>
|
||||
import crudSchBaseTask from './schBaseTask'
|
||||
import crudSchBaseTaskconfig from './config/schBaseTaskconfig'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
@@ -307,17 +322,24 @@ export default {
|
||||
},
|
||||
rules: {
|
||||
},
|
||||
taskStatusList: []
|
||||
taskStatusList: [],
|
||||
taskConfigList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTaskStatusList()
|
||||
this.getTaskConfigList()
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
getTaskConfigList() {
|
||||
crudSchBaseTaskconfig.getTaskConfigList().then(res => {
|
||||
this.taskConfigList = res
|
||||
})
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user