Browse Source

refactor:任务管理

master
李永德 3 weeks ago
parent
commit
69c6efe432
  1. 51
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/task/controller/SchBaseTaskController.java
  2. 25
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/task/dao/SchBaseTask.java
  3. 4
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/task/dao/mapper/SchBaseTaskMapper.java
  4. 58
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/task/dao/mapper/SchBaseTaskMapper.xml
  5. 27
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/task/dto/SchBaseTaskQuery.java
  6. 5
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/task/service/IschBaseTaskService.java
  7. 144
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/task/service/impl/SchBaseTaskServiceImpl.java
  8. 10
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/DjqTask.java
  9. 10
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/DjqToKzjhcwTask.java
  10. 11
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/GzqTask.java
  11. 10
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/GzqToKzjhcwTask.java
  12. 10
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/MzhcwTask.java
  13. 10
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/SendDjqKzjTask.java
  14. 10
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/SendGzqKzjTask.java
  15. 10
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/SsxDjwTask.java
  16. 10
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/ZxDjwTask.java
  17. 10
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/ZxqTask.java
  18. 5
      lms/nladmin-system/src/main/java/org/nl/common/utils/TaskUtils.java
  19. 6
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/classstandard/service/dao/mapper/ClassStandardMapper.xml
  20. 5
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/areapermissions/service/IUserAreaPermissionService.java
  21. 12
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/areapermissions/service/impl/UserAreaPermissionServiceImpl.java
  22. 2
      lms/nladmin-system/src/main/java/org/nl/wms/sch/rest/TaskController.java
  23. 22
      lms/nladmin-ui/src/views/wms/sch/task/index.vue

51
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/task/controller/SchBaseTaskController.java

@ -3,9 +3,15 @@ package org.nl.b_lms.sch.task.controller;
import java.util.Set; import java.util.Set;
import java.util.Map; import java.util.Map;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.nl.b_lms.sch.task.dao.SchBaseTask; import org.nl.b_lms.sch.task.dao.SchBaseTask;
import org.nl.b_lms.sch.task.dto.SchBaseTaskQuery;
import org.nl.common.TableDataInfo; import org.nl.common.TableDataInfo;
import org.nl.wms.sch.manage.FinishTypeEnum;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -26,7 +32,7 @@ import org.nl.b_lms.sch.task.service.IschBaseTaskService;
*/ */
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/api/schBaseTask") @RequestMapping("/api/task")
@Slf4j @Slf4j
public class SchBaseTaskController { public class SchBaseTaskController {
@ -43,10 +49,51 @@ public class SchBaseTaskController {
*/ */
@GetMapping @GetMapping
@Log("查询任务表") @Log("查询任务表")
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); return new ResponseEntity<>(TableDataInfo.build(schBaseTaskService.queryAll(whereJson, page)), HttpStatus.OK);
} }
@GetMapping("/taskStatus")
@Log("获取任务状态列表")
public ResponseEntity<Object> getTaskStatus() {
TaskStatusEnum[] values = TaskStatusEnum.values();
JSONArray arr = new JSONArray();
for (TaskStatusEnum value : values) {
JSONObject json = new JSONObject();
json.put("code", value.getCode());
json.put("name", value.getName());
arr.add(json);
}
//增加未完成状态
JSONObject unFinish = new JSONObject();
unFinish.put("code", "-1");
unFinish.put("name", "未完成");
arr.add(unFinish);
return new ResponseEntity<>(arr, HttpStatus.OK);
}
@GetMapping("/finishType")
@Log("获取任务类型列表")
public ResponseEntity<Object> getFinishType() {
FinishTypeEnum[] values = FinishTypeEnum.values();
JSONArray arr = new JSONArray();
for (FinishTypeEnum value : values) {
JSONObject json = new JSONObject();
json.put("code", value.getCode());
json.put("name", value.getName());
arr.add(json);
}
return new ResponseEntity<>(arr, HttpStatus.OK);
}
@PutMapping("/operation")
@Log("任务操作")
@SaIgnore
public ResponseEntity<Object> update(@RequestBody Map<String, Object> map) {
schBaseTaskService.operation(map);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
/** /**
* 新增数据 * 新增数据

25
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/task/dao/SchBaseTask.java

@ -1,7 +1,6 @@
package org.nl.b_lms.sch.task.dao; package org.nl.b_lms.sch.task.dao;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.io.Serializable;
import lombok.*; import lombok.*;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
@ -244,13 +243,13 @@ public class SchBaseTask extends Model<SchBaseTask> {
/** /**
* 修改人 * 修改人
*/ */
private String update_optid; private String update_id;
/** /**
* 修改人 * 修改人
*/ */
private String update_optname; private String update_name;
/** /**
@ -275,18 +274,14 @@ public class SchBaseTask extends Model<SchBaseTask> {
* 是否立即下发 * 是否立即下发
*/ */
private String is_send; private String is_send;
@TableField(exist = false)
private String task_type_name;
@TableField(exist = false)
/** private String create_name1;
* 获取主键值 @TableField(exist = false)
* private String task_status_name;
* @return 主键值 @TableField(exist = false)
*/ private String final_product_area;
@Override
protected Serializable pkVal() {
return this.task_id;
}
} }

4
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/task/dao/mapper/SchBaseTaskMapper.java

@ -1,8 +1,10 @@
package org.nl.b_lms.sch.task.dao.mapper; package org.nl.b_lms.sch.task.dao.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt; import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
import org.nl.b_lms.sch.task.dao.SchBaseTask; import org.nl.b_lms.sch.task.dao.SchBaseTask;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.nl.b_lms.sch.task.dto.SchBaseTaskQuery;
import java.util.List; import java.util.List;
@ -27,4 +29,6 @@ public interface SchBaseTaskMapper extends BaseMapper<SchBaseTask> {
* @return / * @return /
*/ */
List<SchBaseTask> getTaskByPlanQzzNoAndDevice(String resourceName); List<SchBaseTask> getTaskByPlanQzzNoAndDevice(String resourceName);
IPage<SchBaseTask> selectPageLeftJoin(IPage<SchBaseTask> pages, SchBaseTaskQuery whereJson, List<String> collect);
} }

58
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/task/dao/mapper/SchBaseTaskMapper.xml

@ -20,4 +20,62 @@
AND p.resource_name = #{resourceName} AND p.resource_name = #{resourceName}
AND IFNULL(p.qzzno, '') <![CDATA[ <> ]]> '' AND IFNULL(p.qzzno, '') <![CDATA[ <> ]]> ''
</select> </select>
<select id="selectPageLeftJoin" resultType="org.nl.b_lms.sch.task.dao.SchBaseTask">
SELECT * FROM (
SELECT
task.*,
md.class_name task_type_name,
user.person_name AS create_name1,
dict.label task_status_name,
case when task.task_type like '0105%' then 'LK' when task.task_type like '0107%' then 'LK' ELSE task.product_area end AS final_product_area
FROM
sch_base_task task
LEFT JOIN md_pb_classstandard md ON task.task_type = md.class_code
LEFT JOIN sys_user user ON user.username = task.create_name
LEFT JOIN sys_dict dict ON dict.`value` = task.task_status AND dict.`code` = 'task_status'
<where>
<if test="whereJson.is_delete != null">
AND task.is_delete = #{whereJson.is_delete}
</if>
<if test="whereJson.task_types != null and whereJson.task_types != ''">
AND task.task_type IN
<foreach collection="whereJson.task_types" item="code" separator="," open="(" close=")">
#{code}
</foreach>
</if>
<if test="whereJson.end_time != null">
AND task.create_time <![CDATA[<=]]> #{whereJson.end_time}
</if>
<if test="whereJson.begin_time != null">
AND task.create_time <![CDATA[>=]]> #{whereJson.begin_time}
</if>
<if test="whereJson.unFinished != null">
AND task.task_status <![CDATA[<=]]> #{whereJson.unFinished}
</if>
<if test="whereJson.vehicle_code != null">
AND task.vehicle_code = #{whereJson.vehicle_code}
</if>
<if test="whereJson.task_code != null">
AND task.task_code = LIKE '%${whereJson.task_code}%'
</if>
<if test="whereJson.point_code1 != null">
AND (task.point_code1 LIKE '%${whereJson.point_code1}%'
OR task.point_code2 LIKE '%${whereJson.point_code1}%')
</if>
<if test="collect != null and collect != ''">
AND task.task_status IN
<foreach collection="collect" item="code" separator="," open="(" close=")">
#{code}
</foreach>
</if>
</where>
) a
WHERE 1=1
<if test="whereJson.in_area_id != null and whereJson.in_area_id != ''">
AND a.final_product_area IN
<foreach collection="whereJson.in_area_id" item="code" separator="," open="(" close=")">
#{code}
</foreach>
</if>
</select>
</mapper> </mapper>

27
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/task/dto/SchBaseTaskQuery.java

@ -0,0 +1,27 @@
package org.nl.b_lms.sch.task.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author: lyd
* @Date: 2024/10/30
*/
@Data
public class SchBaseTaskQuery implements Serializable {
private String task_code;
private String vehicle_code;
private String point_code1;
private String task_status;
private String is_delete;
private String task_type;
private List<String> task_types;
private String begin_time;
private String end_time;
private String more_task_status;
private String unFinished;
private List<String> in_area_id;
}

5
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/task/service/IschBaseTaskService.java

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt; import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
import org.nl.b_lms.sch.task.dao.SchBaseTask; import org.nl.b_lms.sch.task.dao.SchBaseTask;
import org.nl.b_lms.sch.task.dto.SchBaseTaskQuery;
import org.nl.common.domain.query.PageQuery; import org.nl.common.domain.query.PageQuery;
import java.util.List; import java.util.List;
@ -27,7 +28,7 @@ public interface IschBaseTaskService extends IService<SchBaseTask> {
* @param pageable 分页参数 * @param pageable 分页参数
* @return IPage<SchBaseTask> * @return IPage<SchBaseTask>
*/ */
IPage<SchBaseTask> queryAll(Map whereJson, PageQuery pageable); IPage<SchBaseTask> queryAll(SchBaseTaskQuery whereJson, PageQuery pageable);
/** /**
@ -87,6 +88,8 @@ public interface IschBaseTaskService extends IService<SchBaseTask> {
* @return / * @return /
*/ */
Boolean checkHaveTaskByZcPoint(BstIvtCutpointivt point); Boolean checkHaveTaskByZcPoint(BstIvtCutpointivt point);
void operation(Map<String, Object> map);
} }

144
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/task/service/impl/SchBaseTaskServiceImpl.java

@ -1,26 +1,43 @@
package org.nl.b_lms.sch.task.service.impl; package org.nl.b_lms.sch.task.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.SneakyThrows;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt; import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
import org.nl.b_lms.sch.task.dao.SchBaseTask; import org.nl.b_lms.sch.task.dao.SchBaseTask;
import org.nl.b_lms.sch.task.dao.mapper.SchBaseTaskMapper; import org.nl.b_lms.sch.task.dao.mapper.SchBaseTaskMapper;
import org.nl.b_lms.sch.task.dto.SchBaseTaskQuery;
import org.nl.b_lms.sch.task.service.IschBaseTaskService; import org.nl.b_lms.sch.task.service.IschBaseTaskService;
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum; import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
import org.nl.common.domain.query.PageQuery; import org.nl.common.domain.query.PageQuery;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.basedata.master.classstandard.service.IClassStandardService;
import org.nl.wms.basedata.master.classstandard.service.dao.ClassStandard;
import org.nl.wms.basedata.st.areapermissions.service.IUserAreaPermissionService;
import org.nl.wms.sch.manage.TaskStatusEnum; import org.nl.wms.sch.manage.TaskStatusEnum;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.*; import java.util.*;
import java.util.function.Consumer; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/** /**
@ -35,6 +52,13 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
@Autowired @Autowired
private SchBaseTaskMapper schBaseTaskMapper; private SchBaseTaskMapper schBaseTaskMapper;
@Autowired
private IUserAreaPermissionService userAreaPermissionService;
@Autowired
private IClassStandardService classStandardService;
@Autowired
private RedissonClient redissonClient;
/** /**
@ -44,17 +68,32 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
* @param page 分页参数 * @param page 分页参数
*/ */
@Override @Override
public IPage<SchBaseTask> queryAll(Map whereJson, PageQuery page) { public IPage<SchBaseTask> queryAll(SchBaseTaskQuery whereJson, PageQuery page) {
return schBaseTaskMapper.selectPage(new Page<>(page.getPage() + 1, page.getSize()), new QueryWrapper<SchBaseTask>() List<String> collect = ObjectUtil.isNotEmpty(whereJson.getMore_task_status())
.lambda() ? Arrays.stream(whereJson.getMore_task_status().split(",")).collect(Collectors.toList()) : null;
// .like(StringUtils.isNotBlank(form.name()), User::getName, form.name()) if (collect != null) {
// .between(form.beginTime != null && form.endTime != null, User::getCreateTime, beginTime, endTime) if (collect.contains("-1")) {
// .in(form.Status != null, User::getStatus collect = null;
// , UserStatusEnum.NOT_SUBMITTED whereJson.setUnFinished("07");
// , UserStatusEnum.TO_REVIEWED) }
// .orderByDesc(User::getId) }
.eq(SchBaseTask::getIs_delete, 0) if (ObjectUtil.isNotEmpty(whereJson.getTask_type())) {
); // 获取任务类型
ClassStandard dto = classStandardService.getById(whereJson.getTask_type());
ArrayList<String> allChildrenIds = classStandardService.getAllChildrenIds(dto.getClass_id());
if (CollectionUtil.isEmpty(allChildrenIds)) {
allChildrenIds.add(dto.getClass_code());
}
whereJson.setTask_types(allChildrenIds);
}
List<String> in_area_id = userAreaPermissionService.getCurrentUserAreas(SecurityUtils.getCurrentUserId());
if (CollectionUtil.isNotEmpty(in_area_id)) {
whereJson.setIn_area_id(in_area_id);
}
IPage<SchBaseTask> pages = new Page<>(page.getPage() + 1, page.getSize());
pages = schBaseTaskMapper.selectPageLeftJoin(pages, whereJson, collect);
return pages;
} }
@ -128,8 +167,8 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
entity.setCreate_name(SecurityUtils.getCurrentNickName()); entity.setCreate_name(SecurityUtils.getCurrentNickName());
entity.setCreate_time(DateUtil.now()); entity.setCreate_time(DateUtil.now());
} }
entity.setUpdate_optid(SecurityUtils.getCurrentUserId()); entity.setUpdate_id(SecurityUtils.getCurrentUserId());
entity.setUpdate_optname(SecurityUtils.getCurrentNickName()); entity.setUpdate_name(SecurityUtils.getCurrentNickName());
entity.setUpdate_time(DateUtil.now()); entity.setUpdate_time(DateUtil.now());
return entity; return entity;
} }
@ -160,6 +199,81 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
return list(lam).size() > 0; return list(lam).size() > 0;
} }
@SneakyThrows
@Override
public void operation(Map<String, Object> map) {
String task_id = MapUtil.getStr(map, "task_id");
RLock lock = redissonClient.getLock(task_id);
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
try {
if (tryLock) {
String method_name = MapUtil.getStr(map, "method_name");
SchBaseTask taskObj = this.getById(task_id);
if ("finish".equals(method_name)) {
//强制执行,只把任务变更成完成状态
// 更改任务状态为完成
taskObj.setTask_status(TaskStatusEnum.FINISHED.getCode());
taskObj.setUpdate_id(SecurityUtils.getCurrentUserId());
taskObj.setUpdate_name(SecurityUtils.getCurrentNickName());
taskObj.setUpdate_time(DateUtil.now());
taskObj.setRemark("任务被用户:" + SecurityUtils.getCurrentNickName() + "在:" + DateUtil.now() + "强制完成。");
this.updateById(taskObj);
} else {
// 任务处理类
String processing_class = taskObj.getHandle_class();
String message = "";
try {
Object obj = new Object();
try {
obj = SpringContextHolder.getBean(Class.forName(processing_class));
} catch (Exception e) {
Class<?> clz = Class.forName(processing_class);
obj = clz.newInstance();
}
// 调用每个任务类的method_name()强制结束方法
Method m = obj.getClass().getMethod(method_name, String.class);
JSONObject result = (JSONObject) m.invoke(obj, task_id);
if (ObjectUtil.isEmpty(result)) {
return;
}
JSONArray arr = result.getJSONArray("errArr");
LambdaUpdateWrapper<SchBaseTask> lam = new LambdaUpdateWrapper<>();
if (ObjectUtil.isNotEmpty(arr)) {
for (int i = 0; i < arr.size(); i++) {
JSONObject json = arr.getJSONObject(i);
lam.set(SchBaseTask::getRemark, json.getString("message"))
.eq(SchBaseTask::getTask_id, json.getString("task_id"));
this.update(lam);
}
throw new BadRequestException("任务操作失败!");
} else {
lam.set(SchBaseTask::getRemark, "操作成功")
.eq(SchBaseTask::getTask_id, task_id);
this.update(lam);
}
} catch (InvocationTargetException e) {
if (ObjectUtil.isNull(e.getTargetException().getMessage())) {
message = e.getTargetException().toString();
} else {
message = e.getTargetException().getMessage();
}
throw new BadRequestException(message);
} catch (Exception e) {
e.printStackTrace();
throw new BadRequestException(e.getMessage());
}
}
} else {
throw new BadRequestException("任务标识为:" + task_id + "的任务正在操作中!");
}
} finally {
if (tryLock) {
lock.unlock();
}
}
}
} }

10
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/DjqTask.java

@ -92,8 +92,8 @@ public class DjqTask extends AbstractAcsTask {
if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return; if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return;
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskObj.getString("task_id")) .eq(SchBaseTask::getTask_id, taskObj.getString("task_id"))
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) { if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
// 更新任务状态为执行中 // 更新任务状态为执行中
@ -263,13 +263,13 @@ public class DjqTask extends AbstractAcsTask {
} }
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId) .eq(SchBaseTask::getTask_id, taskId)
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
//任务被标记为取消 //任务被标记为取消
updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是")); updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是"));
updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode()); updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode());
updateWrapper.set(SchBaseTask::getRemark,"任务被用户:" + schBaseTask.getUpdate_optname() + "在:" + schBaseTask.getUpdate_time() + "强制取消。"); updateWrapper.set(SchBaseTask::getRemark,"任务被用户:" + schBaseTask.getUpdate_name() + "在:" + schBaseTask.getUpdate_time() + "强制取消。");
taskService.update(null,updateWrapper); taskService.update(null,updateWrapper);
} }

10
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/DjqToKzjhcwTask.java

@ -87,8 +87,8 @@ public class DjqToKzjhcwTask extends AbstractAcsTask {
if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return; if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return;
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskObj.getString("task_id")) .eq(SchBaseTask::getTask_id, taskObj.getString("task_id"))
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) { if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
// 更新任务状态为执行中 // 更新任务状态为执行中
@ -205,13 +205,13 @@ public class DjqToKzjhcwTask extends AbstractAcsTask {
} }
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId) .eq(SchBaseTask::getTask_id, taskId)
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
//任务被标记为取消 //任务被标记为取消
updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是")); updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是"));
updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode()); updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode());
updateWrapper.set(SchBaseTask::getRemark,"任务被用户:" + schBaseTask.getUpdate_optname() + "在:" + schBaseTask.getUpdate_time() + "强制取消。"); updateWrapper.set(SchBaseTask::getRemark,"任务被用户:" + schBaseTask.getUpdate_name() + "在:" + schBaseTask.getUpdate_time() + "强制取消。");
taskService.update(null,updateWrapper); taskService.update(null,updateWrapper);
} }

11
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/GzqTask.java

@ -18,7 +18,6 @@ import org.nl.b_lms.sch.task.service.IschBaseTaskService;
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum; import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
import org.nl.common.enums.PackageInfoIvtEnum; import org.nl.common.enums.PackageInfoIvtEnum;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import org.nl.common.utils.TaskUtils;
import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BadRequestException;
import org.nl.wms.sch.AcsTaskDto; import org.nl.wms.sch.AcsTaskDto;
import org.nl.wms.sch.manage.AbstractAcsTask; import org.nl.wms.sch.manage.AbstractAcsTask;
@ -86,8 +85,8 @@ public class GzqTask extends AbstractAcsTask {
if (TaskUtil.checkParams(schBaseTask, THIS_CLASS,TaskStatusEnum.FINISHED.getCode())) return; if (TaskUtil.checkParams(schBaseTask, THIS_CLASS,TaskStatusEnum.FINISHED.getCode())) return;
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskObj.getString("task_id")) .eq(SchBaseTask::getTask_id, taskObj.getString("task_id"))
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) { if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
// 更新任务状态为执行中 // 更新任务状态为执行中
@ -205,13 +204,13 @@ public class GzqTask extends AbstractAcsTask {
} }
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId) .eq(SchBaseTask::getTask_id, taskId)
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
//任务被标记为取消 //任务被标记为取消
updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是")); updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是"));
updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode()); updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode());
updateWrapper.set(SchBaseTask::getRemark,"任务被用户:" + schBaseTask.getUpdate_optname() + "在:" + schBaseTask.getUpdate_time() + "强制取消。"); updateWrapper.set(SchBaseTask::getRemark,"任务被用户:" + schBaseTask.getUpdate_name() + "在:" + schBaseTask.getUpdate_time() + "强制取消。");
taskService.update(null,updateWrapper); taskService.update(null,updateWrapper);
} }

10
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/GzqToKzjhcwTask.java

@ -89,8 +89,8 @@ public class GzqToKzjhcwTask extends AbstractAcsTask {
if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return; if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return;
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskObj.getString("task_id")) .eq(SchBaseTask::getTask_id, taskObj.getString("task_id"))
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) { if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
// 更新任务状态为执行中 // 更新任务状态为执行中
@ -207,13 +207,13 @@ public class GzqToKzjhcwTask extends AbstractAcsTask {
} }
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId) .eq(SchBaseTask::getTask_id, taskId)
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
//任务被标记为取消 //任务被标记为取消
updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是")); updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是"));
updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode()); updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode());
updateWrapper.set(SchBaseTask::getRemark,"任务被用户:" + schBaseTask.getUpdate_optname() + "在:" + schBaseTask.getUpdate_time() + "强制取消。"); updateWrapper.set(SchBaseTask::getRemark,"任务被用户:" + schBaseTask.getUpdate_name() + "在:" + schBaseTask.getUpdate_time() + "强制取消。");
taskService.update(null,updateWrapper); taskService.update(null,updateWrapper);
} }

10
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/MzhcwTask.java

@ -113,8 +113,8 @@ public class MzhcwTask extends AbstractAcsTask {
if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return; if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return;
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskObj.getString("task_id")) .eq(SchBaseTask::getTask_id, taskObj.getString("task_id"))
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
// 执行中 // 执行中
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) { if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
@ -388,13 +388,13 @@ public class MzhcwTask extends AbstractAcsTask {
} }
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId) .eq(SchBaseTask::getTask_id, taskId)
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
//任务被标记为取消 //任务被标记为取消
updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是")); updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是"));
updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode()); updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode());
updateWrapper.set(SchBaseTask::getRemark,"任务被用户:" + schBaseTask.getUpdate_optname() + "在:" + schBaseTask.getUpdate_time() + "强制取消。"); updateWrapper.set(SchBaseTask::getRemark,"任务被用户:" + schBaseTask.getUpdate_name() + "在:" + schBaseTask.getUpdate_time() + "强制取消。");
taskService.update(null,updateWrapper); taskService.update(null,updateWrapper);
} }

10
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/SendDjqKzjTask.java

@ -84,8 +84,8 @@ public class SendDjqKzjTask extends AbstractAcsTask {
if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return; if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return;
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskObj.getString("task_id")) .eq(SchBaseTask::getTask_id, taskObj.getString("task_id"))
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) { if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
// 更新任务状态为执行中 // 更新任务状态为执行中
@ -185,13 +185,13 @@ public class SendDjqKzjTask extends AbstractAcsTask {
} }
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId) .eq(SchBaseTask::getTask_id, taskId)
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
//任务被标记为取消 //任务被标记为取消
updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是")); updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是"));
updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode()); updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode());
updateWrapper.set(SchBaseTask::getRemark, "任务被用户:" + schBaseTask.getUpdate_optname() + "在:" + schBaseTask.getUpdate_time() + "强制取消。"); updateWrapper.set(SchBaseTask::getRemark, "任务被用户:" + schBaseTask.getUpdate_name() + "在:" + schBaseTask.getUpdate_time() + "强制取消。");
taskService.update(null, updateWrapper); taskService.update(null, updateWrapper);
} }

10
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/SendGzqKzjTask.java

@ -84,8 +84,8 @@ public class SendGzqKzjTask extends AbstractAcsTask {
if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return; if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return;
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskObj.getString("task_id")) .eq(SchBaseTask::getTask_id, taskObj.getString("task_id"))
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) { if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
// 更新任务状态为执行中 // 更新任务状态为执行中
@ -184,13 +184,13 @@ public class SendGzqKzjTask extends AbstractAcsTask {
} }
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId) .eq(SchBaseTask::getTask_id, taskId)
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
//任务被标记为取消 //任务被标记为取消
updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是")); updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是"));
updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode()); updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode());
updateWrapper.set(SchBaseTask::getRemark, "任务被用户:" + schBaseTask.getUpdate_optname() + "在:" + schBaseTask.getUpdate_time() + "强制取消。"); updateWrapper.set(SchBaseTask::getRemark, "任务被用户:" + schBaseTask.getUpdate_name() + "在:" + schBaseTask.getUpdate_time() + "强制取消。");
taskService.update(null, updateWrapper); taskService.update(null, updateWrapper);
} }

10
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/SsxDjwTask.java

@ -86,8 +86,8 @@ public class SsxDjwTask extends AbstractAcsTask {
if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return; if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return;
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskObj.getString("task_id")) .eq(SchBaseTask::getTask_id, taskObj.getString("task_id"))
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) { if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
// 更新任务状态为执行中 // 更新任务状态为执行中
@ -211,13 +211,13 @@ public class SsxDjwTask extends AbstractAcsTask {
} }
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId) .eq(SchBaseTask::getTask_id, taskId)
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
//任务被标记为取消 //任务被标记为取消
updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是")); updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是"));
updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode()); updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode());
updateWrapper.set(SchBaseTask::getRemark,"任务被用户:" + schBaseTask.getUpdate_optname() + "在:" + schBaseTask.getUpdate_time() + "强制取消。"); updateWrapper.set(SchBaseTask::getRemark,"任务被用户:" + schBaseTask.getUpdate_name() + "在:" + schBaseTask.getUpdate_time() + "强制取消。");
taskService.update(null,updateWrapper); taskService.update(null,updateWrapper);
} }

10
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/ZxDjwTask.java

@ -115,8 +115,8 @@ public class ZxDjwTask extends AbstractAcsTask {
if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return; if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return;
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskObj.getString("task_id")) .eq(SchBaseTask::getTask_id, taskObj.getString("task_id"))
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) { if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
// 更新任务状态为执行中 // 更新任务状态为执行中
@ -267,13 +267,13 @@ public class ZxDjwTask extends AbstractAcsTask {
} }
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId) .eq(SchBaseTask::getTask_id, taskId)
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
//任务被标记为取消 //任务被标记为取消
updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是")); updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是"));
updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode()); updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode());
updateWrapper.set(SchBaseTask::getRemark, "任务被用户:" + schBaseTask.getUpdate_optname() + "在:" + schBaseTask.getUpdate_time() + "强制取消。"); updateWrapper.set(SchBaseTask::getRemark, "任务被用户:" + schBaseTask.getUpdate_name() + "在:" + schBaseTask.getUpdate_time() + "强制取消。");
taskService.update(null, updateWrapper); taskService.update(null, updateWrapper);
} }

10
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/ZxqTask.java

@ -112,8 +112,8 @@ public class ZxqTask extends AbstractAcsTask {
if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return; if (TaskUtil.checkParams(schBaseTask, THIS_CLASS, TaskStatusEnum.FINISHED.getCode())) return;
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskObj.getString("task_id")) .eq(SchBaseTask::getTask_id, taskObj.getString("task_id"))
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) { if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
// 更新任务状态为执行中 // 更新任务状态为执行中
@ -358,13 +358,13 @@ public class ZxqTask extends AbstractAcsTask {
} }
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>() LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId) .eq(SchBaseTask::getTask_id, taskId)
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId()) .set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentUsername()) .set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentUsername())
.set(SchBaseTask::getUpdate_time, DateUtil.now()); .set(SchBaseTask::getUpdate_time, DateUtil.now());
//任务被标记为取消 //任务被标记为取消
updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是")); updateWrapper.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是"));
updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode()); updateWrapper.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode());
updateWrapper.set(SchBaseTask::getRemark, "任务被用户:" + schBaseTask.getUpdate_optname() + "在:" + schBaseTask.getUpdate_time() + "强制取消。"); updateWrapper.set(SchBaseTask::getRemark, "任务被用户:" + schBaseTask.getUpdate_name() + "在:" + schBaseTask.getUpdate_time() + "强制取消。");
taskService.update(null, updateWrapper); taskService.update(null, updateWrapper);
} }

5
lms/nladmin-system/src/main/java/org/nl/common/utils/TaskUtils.java

@ -2,7 +2,6 @@ package org.nl.common.utils;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt; import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
import org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.BstIvtShafttubeivt; import org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.BstIvtShafttubeivt;
@ -99,8 +98,8 @@ public class TaskUtils {
* @param task 任务 * @param task 任务
*/ */
public static void updateOptMessageByTask(SchBaseTask task) { public static void updateOptMessageByTask(SchBaseTask task) {
task.setUpdate_optid(SecurityUtils.getCurrentUserId()); task.setUpdate_id(SecurityUtils.getCurrentUserId());
task.setUpdate_optname(SecurityUtils.getCurrentUsername()); task.setUpdate_name(SecurityUtils.getCurrentUsername());
task.setUpdate_time(DateUtil.now()); task.setUpdate_time(DateUtil.now());
} }

6
lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/classstandard/service/dao/mapper/ClassStandardMapper.xml

@ -4,13 +4,13 @@
<select id="getAllChildrenIds" resultType="java.lang.String"> <select id="getAllChildrenIds" resultType="java.lang.String">
SELECT DISTINCT SELECT DISTINCT
class_id class_code
FROM ( FROM (
SELECT SELECT
t1.class_id, t1.class_code,
IF(find_in_set(parent_class_id, @pids) > 0, @pids := concat(@pids, ',', class_id), 0) AS ischild IF(find_in_set(parent_class_id, @pids) > 0, @pids := concat(@pids, ',', class_id), 0) AS ischild
FROM ( FROM (
SELECT class_id, parent_class_id FROM md_pb_classstandard t WHERE t.is_delete = '0' ORDER BY class_code SELECT class_code, class_id, parent_class_id FROM md_pb_classstandard t WHERE t.is_delete = '0' ORDER BY class_code
) t1, ) t1,
(SELECT @pids := #{classId}) t2 (SELECT @pids := #{classId}) t2
) t3 ) t3

5
lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/areapermissions/service/IUserAreaPermissionService.java

@ -44,4 +44,9 @@ public interface IUserAreaPermissionService extends IService<UserAreaPermission>
String getInArea(); String getInArea();
/**
* 获取当前用户对应的区域数组
* @return
*/
List<String> getCurrentUserAreas(String currentUserId);
} }

12
lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/areapermissions/service/impl/UserAreaPermissionServiceImpl.java

@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @Author: lyd * @Author: lyd
@ -104,4 +105,15 @@ public class UserAreaPermissionServiceImpl extends ServiceImpl<UserAreaPermissio
} }
return in_stor_id; return in_stor_id;
} }
@Override
public List<String> getCurrentUserAreas(String currentUserId) {
if (ObjectUtil.isEmpty(currentUserId)) {
return null;
}
LambdaQueryWrapper<UserAreaPermission> lam = new LambdaQueryWrapper<>();
lam.eq(UserAreaPermission::getUser_id, currentUserId);
List<UserAreaPermission> list = userAreaPermissionMapper.selectList(lam);
return list.stream().map(UserAreaPermission::getProduct_area).collect(Collectors.toList());
}
} }

2
lms/nladmin-system/src/main/java/org/nl/wms/sch/rest/TaskController.java

@ -23,7 +23,7 @@ import java.util.Map;
**/ **/
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/api/task") @RequestMapping("/api/task2")
@Slf4j @Slf4j
public class TaskController { public class TaskController {

22
lms/nladmin-ui/src/views/wms/sch/task/index.vue

@ -67,7 +67,7 @@
v-model="query.is_delete" v-model="query.is_delete"
class="filter-item" class="filter-item"
clearable clearable
@change="handTaskStatus" @change="hand"
> >
<el-option <el-option
v-for="item in deleteList" v-for="item in deleteList"
@ -229,7 +229,15 @@ export default {
sort: 'create_time,desc', sort: 'create_time,desc',
crudMethod: { ...crudTask }, crudMethod: { ...crudTask },
query: { query: {
task_code: '', is_delete: '0', vehicle_code: '', start_point_code: '', next_point_code: '', task_type: '', finished_type: '', task_status: ['-1'] task_code: '',
is_delete: '0',
vehicle_code: '',
start_point_code: '',
next_point_code: '',
task_type: '',
finished_type: '',
more_task_status: '-1',
task_status: ['-1']
}, },
optShow: { optShow: {
add: false, add: false,
@ -279,7 +287,7 @@ export default {
parent_class_code: 'task_type' parent_class_code: 'task_type'
} }
crudClassstandard.getClassType(param).then(res => { crudClassstandard.getClassType(param).then(res => {
const data = res.content const data = res
this.buildTree(data) this.buildTree(data)
this.classes1 = data this.classes1 = data
}) })
@ -297,9 +305,8 @@ export default {
// //
loadChildNodes({ action, parentNode, callback }) { loadChildNodes({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) { if (action === LOAD_CHILDREN_OPTIONS) {
debugger
crudClassstandard.getClass({ pid: parentNode.id }).then(res => { crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
parentNode.children = res.content.map(function(obj) { parentNode.children = res.map(function(obj) {
if (obj.hasChildren) { if (obj.hasChildren) {
obj.children = null obj.children = null
} }
@ -312,13 +319,12 @@ export default {
} }
}, },
hand(value) { hand(value) {
debugger
this.crud.toQuery() this.crud.toQuery()
}, },
handTaskStatus(value) { handTaskStatus(value) {
debugger
if (value) { if (value) {
this.query.task_status = this.task_status.toString() console.log(value)
this.crud.query.more_task_status = value.toString()
} }
this.crud.toQuery() this.crud.toQuery()
}, },

Loading…
Cancel
Save