| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.vincent.rsf.server.manager.service.TaskService; |
| | | import com.vincent.rsf.server.manager.enums.TaskType; |
| | | import com.vincent.rsf.server.system.constant.DictTypeCode; |
| | | import com.vincent.rsf.server.system.entity.DictData; |
| | | import com.vincent.rsf.server.system.service.DictDataService; |
| | | import lombok.experimental.Accessors; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | import com.vincent.rsf.server.system.service.UserService; |
| | | import com.vincent.rsf.server.system.entity.User; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.stream.Collectors; |
| | | import com.vincent.rsf.server.manager.service.BasStationService; |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @TableName("man_task") |
| | | @TableName(value = "man_task", autoResultMap = true) |
| | | @ApiModel(value = "Task", description = "任务档") |
| | | public class Task implements Serializable { |
| | | /** |
| | |
| | | */ |
| | | @ApiModelProperty(value= "任务状态") |
| | | private Integer taskStatus; |
| | | |
| | | /** 是否存在可执行的当前流程步骤,用于列表是否展示完成按钮 */ |
| | | @TableField(exist = false,select = false) |
| | | @ApiModelProperty(value = "是否可点击完成(有当前步骤且非终态)") |
| | | private Boolean canComplete; |
| | | |
| | | /** 是否可取消:流程步骤能对应上 taskStatus 且未到最后一步(9999) 时为 true */ |
| | | @TableField(exist = false, select = false) |
| | | @ApiModelProperty(value = "是否可取消") |
| | | private Boolean canCancel; |
| | | |
| | | @ApiModelProperty("上级任务ID") |
| | | private Long parentId; |
| | |
| | | @ApiModelProperty(value= "添加人员") |
| | | private Long createBy; |
| | | |
| | | @TableField(exist = false) |
| | | private String createBy$; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | |
| | | @ApiModelProperty(value= "修改人员") |
| | | private Long updateBy; |
| | | |
| | | @TableField(exist = false) |
| | | private String updateBy$; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | @Version |
| | | private Integer version; |
| | | |
| | | /** |
| | | * 备注 |
| | |
| | | */ |
| | | @ApiModelProperty(value= "步序终点") |
| | | private String endStep; |
| | | |
| | | @TableField(typeHandler = JacksonTypeHandler.class) |
| | | private List<String> targSiteArea; |
| | | |
| | | private String targLocArea; |
| | | |
| | | private String targSiteAreaNow; |
| | | @TableField(exist = false) |
| | | private String taskStatus$; |
| | | |
| | | @TableField(exist = false) |
| | | private String warehType$; |
| | | |
| | | @TableField(exist = false) |
| | | private String orgSite$; |
| | | |
| | | @TableField(exist = false) |
| | | private String targSite$; |
| | | |
| | | |
| | | |
| | | public Task() {} |
| | | |
| | |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | // public String getParentId$() { |
| | | // if (Cools.isEmpty(this.parentId)) { |
| | | // return null; |
| | | // } |
| | | // TaskService taskService = SpringUtils.getBean(TaskService.class); |
| | | // Task task = taskService.getById(this.parentId); |
| | | // return task.getTaskCode(); |
| | | // } |
| | | |
| | | |
| | | public String getTaskStatus$(){ |
| | | if (Cools.isEmpty(this.taskStatus)) { |
| | | return null; |
| | | } |
| | | DictDataService dictDataService = SpringUtils.getBean(DictDataService.class); |
| | | DictData dictDatas = dictDataService.getOne(new LambdaQueryWrapper<DictData>() |
| | | .eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_TASK_STATUS) |
| | | .eq(DictData::getValue, this.taskStatus)); |
| | | if (Objects.isNull(dictDatas) || Objects.isNull(dictDatas.getLabel())) { |
| | | return null; |
| | | } |
| | | return dictDatas.getValue() + "." + dictDatas.getLabel(); |
| | | return this.taskStatus$; |
| | | } |
| | | |
| | | public String getWarehType$(){ |
| | | if (null == this.warehType){ return null; } |
| | | DictDataService dictDataService = SpringUtils.getBean(DictDataService.class); |
| | | DictData dictDatas = dictDataService.getOne(new LambdaQueryWrapper<DictData>() |
| | | .eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_DEVICE_TYPE) |
| | | .eq(DictData::getValue, warehType)); |
| | | if (Objects.isNull(dictDatas)) { |
| | | return null; |
| | | } |
| | | return dictDatas.getLabel(); |
| | | return this.warehType$; |
| | | } |
| | | |
| | | public String getTaskType$() { |
| | | if (Cools.isEmpty(this.taskType)) { |
| | | return null; |
| | | } |
| | | DictDataService dictDataService = SpringUtils.getBean(DictDataService.class); |
| | | DictData dictDatas = dictDataService.getOne(new LambdaQueryWrapper<DictData>() |
| | | .eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_TASK_TYPE) |
| | | .eq(DictData::getValue, this.taskType)); |
| | | if (Objects.isNull(dictDatas) || Objects.isNull(dictDatas.getLabel())) { |
| | | return null; |
| | | } |
| | | return dictDatas.getValue() + "." + dictDatas.getLabel(); |
| | | return TaskType.getTypeDesc(taskType); |
| | | } |
| | | |
| | | public String getStartTime$(){ |
| | |
| | | } |
| | | } |
| | | |
| | | public String getCreateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.createBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | |
| | | * 获取源站点名称(站点编号 + 站点名称) |
| | | */ |
| | | public String getOrgSite$(){ |
| | | if (Cools.isEmpty(this.orgSite)) { |
| | | return this.orgSite; |
| | | } |
| | | BasStationService basStationService = SpringUtils.getBean(BasStationService.class); |
| | | BasStation station = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .eq(BasStation::getStationName, this.orgSite)); |
| | | if (!Cools.isEmpty(station) && !Cools.isEmpty(station.getStationId())) { |
| | | return this.orgSite + "(" + station.getStationId() + ")"; |
| | | } |
| | | return this.orgSite; |
| | | return this.orgSite$; |
| | | } |
| | | |
| | | /** |
| | | * 获取目标站点名称(站点编号 + 站点名称) |
| | | */ |
| | | public String getTargSite$(){ |
| | | if (Cools.isEmpty(this.targSite)) { |
| | | return this.targSite; |
| | | } |
| | | BasStationService basStationService = SpringUtils.getBean(BasStationService.class); |
| | | BasStation station = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .eq(BasStation::getStationName, this.targSite)); |
| | | if (!Cools.isEmpty(station) && !Cools.isEmpty(station.getStationId())) { |
| | | return this.targSite + "(" + station.getStationId() + ")"; |
| | | } |
| | | return this.targSite; |
| | | return this.targSite$; |
| | | } |
| | | |
| | | } |