1. 下载导入模板
This commit is contained in:
parent
553a0d9b4f
commit
a8ec519bbe
|
|
@ -17,9 +17,9 @@
|
|||
package com.chushang.common.core.config;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import com.chushang.common.core.jackson.JavaTimeModule;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
package com.chushang.common.core.jackson;
|
||||
|
||||
import com.fasterxml.jackson.databind.JavaType;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
public class JacksonUtils {
|
||||
|
||||
private static final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@SneakyThrows
|
||||
public static String toJSONString(Object data) {
|
||||
if (null == data) {
|
||||
return "";
|
||||
}
|
||||
return mapper.writeValueAsString(data);
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public static <T> T json2Bean(String jsonData, Class<T> beanType) {
|
||||
if (null == jsonData) {
|
||||
return null;
|
||||
}
|
||||
return mapper.readValue(jsonData, beanType);
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public static <T> List<T> json2List(String jsonData, Class<T> beanType) {
|
||||
if (null == jsonData) {
|
||||
return List.of();
|
||||
}
|
||||
JavaType javaType = mapper.getTypeFactory().constructParametricType(List.class, beanType);
|
||||
return mapper.readValue(jsonData, javaType);
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public static <K, V> Map<K, V> json2Map(String jsonData, Class<K> keyType, Class<V> valueType) {
|
||||
if (null == jsonData) {
|
||||
return Map.of();
|
||||
}
|
||||
JavaType javaType = mapper.getTypeFactory().constructMapType(Map.class, keyType, valueType);
|
||||
return mapper.readValue(jsonData, javaType);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* Copyright (c) 2020 pig4cloud Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.chushang.common.core.jackson;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.fasterxml.jackson.datatype.jsr310.PackageVersion;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.InstantSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
public class JavaTimeModule extends SimpleModule {
|
||||
|
||||
public JavaTimeModule() {
|
||||
super(PackageVersion.VERSION);
|
||||
|
||||
// ======================= 时间序列化规则 ===============================
|
||||
// yyyy-MM-dd HH:mm:ss
|
||||
this.addSerializer(LocalDateTime.class,
|
||||
new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
|
||||
// yyyy-MM-dd
|
||||
this.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ISO_LOCAL_DATE));
|
||||
// HH:mm:ss
|
||||
this.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ISO_LOCAL_TIME));
|
||||
// Instant 类型序列化
|
||||
this.addSerializer(Instant.class, InstantSerializer.INSTANCE);
|
||||
|
||||
// ======================= 时间反序列化规则 ==============================
|
||||
// yyyy-MM-dd HH:mm:ss
|
||||
this.addDeserializer(LocalDateTime.class,
|
||||
new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
|
||||
// yyyy-MM-dd
|
||||
this.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ISO_LOCAL_DATE));
|
||||
// HH:mm:ss
|
||||
this.addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ISO_LOCAL_TIME));
|
||||
// Instant 反序列化
|
||||
this.addDeserializer(Instant.class, InstantDeserializer.INSTANT);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -24,6 +24,14 @@ public class TreeNode<T> implements Serializable {
|
|||
* 上级ID
|
||||
*/
|
||||
private Long parentId;
|
||||
/**
|
||||
* 父级名称
|
||||
*/
|
||||
private String parentName;
|
||||
/**
|
||||
* 用于获取 name
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 子节点列表
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ public class TreeUtils {
|
|||
for (T node : nodeMap.values()) {
|
||||
T parent = nodeMap.get(node.getParentId());
|
||||
if (parent != null && !(node.getId().equals(parent.getId()))) {
|
||||
node.setParentName(parent.getName());
|
||||
parent.getChildren().add(node);
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,46 +0,0 @@
|
|||
package com.chushang.redis.advice;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.servlet.ServletUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.chushang.common.core.util.IPUtils;
|
||||
import com.chushang.redis.annotation.AutoIdempotent;
|
||||
import com.chushang.redis.cache.utils.RedisUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.http.HttpInputMessage;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapter;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.lang.reflect.Type;
|
||||
import java.time.Duration;
|
||||
|
||||
@RestControllerAdvice
|
||||
@SuppressWarnings("all")
|
||||
@RequiredArgsConstructor
|
||||
public class IdempotentAdvice extends RequestBodyAdviceAdapter {
|
||||
@Override
|
||||
public boolean supports(MethodParameter methodParameter, Type targetType, Class<? extends HttpMessageConverter<?>> converterType) {
|
||||
return methodParameter.hasMethodAnnotation(AutoIdempotent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object afterBodyRead(Object body, HttpInputMessage inputMessage, MethodParameter parameter, Type targetType, Class<? extends HttpMessageConverter<?>> converterType) {
|
||||
String value = JSON.toJSONString(body);
|
||||
if (StrUtil.isEmpty(value)) {
|
||||
return body;
|
||||
}
|
||||
HttpServletRequest request = IPUtils.getRequest();
|
||||
String key = StrUtil.format("{}_{}", ServletUtil.getClientIP(request), request.getRequestURI());
|
||||
AutoIdempotent idempotent = parameter.getMethodAnnotation(AutoIdempotent.class);
|
||||
try {
|
||||
Assert.isTrue(RedisUtils.tryLock(key, idempotent.expireTime()), "请勿重复提交");
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return body;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
package com.chushang.redis.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 幂等性注解
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface AutoIdempotent {
|
||||
|
||||
/** 时间(秒) */
|
||||
long expireTime() default 5;
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
package com.chushang.inspection.project.dto;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import com.alibaba.excel.annotation.format.DateTimeFormat;
|
||||
import com.chushang.common.core.validator.Create;
|
||||
import com.chushang.common.core.validator.Update;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
|
@ -55,12 +57,14 @@ public class TaskDTO implements Serializable {
|
|||
* 项目开始时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(DatePattern.NORM_DATETIME_MS_PATTERN)
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 项目结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(DatePattern.NORM_DATETIME_MS_PATTERN)
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.chushang.inspection.project.vo;
|
|||
import cn.hutool.core.date.DatePattern;
|
||||
import com.alibaba.excel.annotation.format.DateTimeFormat;
|
||||
import com.chushang.common.core.util.TreeNode;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
|
@ -16,17 +17,18 @@ import java.util.List;
|
|||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class TaskVO extends TreeNode<TaskVO> {
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
private Long taskId;
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
private String taskName;
|
||||
/**
|
||||
* 任务联系人
|
||||
*/
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
|
|
@ -40,13 +42,11 @@ public class TaskVO extends TreeNode<TaskVO> {
|
|||
/**
|
||||
* 项目开始时间
|
||||
*/
|
||||
@DateTimeFormat(DatePattern.NORM_DATETIME_MS_PATTERN)
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 项目结束时间
|
||||
*/
|
||||
@DateTimeFormat(DatePattern.NORM_DATETIME_MS_PATTERN)
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
|
|
@ -90,7 +90,11 @@ public class TaskVO extends TreeNode<TaskVO> {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@DateTimeFormat(DatePattern.NORM_DATETIME_MS_PATTERN)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 所属项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.chushang.inspection.project.dto.Delete;
|
|||
import com.chushang.inspection.project.dto.TaskDTO;
|
||||
import com.chushang.inspection.project.dto.TaskExcelDTO;
|
||||
import com.chushang.inspection.project.dto.TaskQuery;
|
||||
import com.chushang.inspection.project.service.TbTemplateService;
|
||||
import com.chushang.inspection.project.vo.ConfigVO;
|
||||
import com.chushang.inspection.project.vo.TaskVO;
|
||||
import com.chushang.inspection.project.service.PollingTaskService;
|
||||
|
|
@ -33,6 +34,8 @@ public class PollTaskController {
|
|||
|
||||
@Resource
|
||||
PollingTaskService pollingTaskService;
|
||||
@Resource
|
||||
TbTemplateService tbTemplateService;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -150,4 +153,12 @@ public class PollTaskController {
|
|||
}
|
||||
|
||||
// todo 下载导入模板
|
||||
@SysLog(value = "导入模板", businessType = BusinessType.DOWNLOAD)
|
||||
@PostMapping("/down/template")
|
||||
// @RequiresPermissions("task:down:template")
|
||||
public AjaxResult downTemplate(@RequestParam(defaultValue = "111") String templateAlias,
|
||||
@RequestParam(defaultValue = "") Long taskId)
|
||||
{
|
||||
return AjaxResult.success(tbTemplateService.getByAlias(templateAlias, taskId));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,4 +51,15 @@ public class TemplateController {
|
|||
return AjaxResult.success(tbTemplateService.updateTemplate(template));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除模板
|
||||
*/
|
||||
@SysLog(value = "模板", businessType = BusinessType.UPDATE)
|
||||
@DeleteMapping(value = "/del/{templateId}")
|
||||
@RequiresPermissions(value = "ins:template:del")
|
||||
public AjaxResult del(@PathVariable Long templateId){
|
||||
return AjaxResult.success(tbTemplateService.removeById(templateId));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
package com.chushang.inspection.project.service;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.chushang.common.mybatis.page.CommonParam;
|
||||
import com.chushang.inspection.project.dto.TaskDTO;
|
||||
import com.chushang.inspection.project.dto.TaskExcelDTO;
|
||||
import com.chushang.inspection.project.dto.TaskQuery;
|
||||
import com.chushang.inspection.project.po.PollingTask;
|
||||
import com.chushang.inspection.project.po.Template;
|
||||
import com.chushang.inspection.project.vo.ConfigVO;
|
||||
import com.chushang.inspection.project.vo.TaskVO;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.chushang.inspection.project.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.chushang.common.mybatis.enums.Operator;
|
||||
import com.chushang.common.mybatis.utils.PageResult;
|
||||
import com.chushang.inspection.project.po.Template;
|
||||
|
||||
|
|
@ -14,4 +16,12 @@ public interface TbTemplateService extends IService<Template> {
|
|||
Long saveTemplate(Template template);
|
||||
|
||||
Long updateTemplate(Template template);
|
||||
|
||||
default Template getByAlias(String alias, Long taskId){
|
||||
return getOne(new LambdaQueryWrapper<Template>()
|
||||
.eq(Template::getTemplateAlias, alias)
|
||||
.eq(null != taskId, Template::getTaskId, taskId)
|
||||
.last(Operator.LIMIT_ONE.getCharacter())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.alibaba.nacos.shaded.com.google.common.collect.Maps;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.chushang.common.core.constant.SecurityConstants;
|
||||
import com.chushang.common.core.util.SpringUtils;
|
||||
import com.chushang.common.core.util.StringUtils;
|
||||
import com.chushang.common.core.util.TreeUtils;
|
||||
import com.chushang.common.core.web.Result;
|
||||
|
|
@ -23,6 +24,8 @@ import com.chushang.datascope.annotation.DataScope;
|
|||
import com.chushang.inspection.project.dto.TaskDTO;
|
||||
import com.chushang.inspection.project.dto.TaskExcelDTO;
|
||||
import com.chushang.inspection.project.dto.TaskQuery;
|
||||
import com.chushang.inspection.project.po.Template;
|
||||
import com.chushang.inspection.project.service.TbTemplateService;
|
||||
import com.chushang.inspection.project.vo.ConfigVO;
|
||||
import com.chushang.inspection.project.vo.TaskVO;
|
||||
import com.chushang.inspection.project.service.PollingTaskService;
|
||||
|
|
@ -100,7 +103,7 @@ public class PollingTaskServiceImpl extends ServiceImpl<PollingTaskMapper, Polli
|
|||
}else {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Set<String> searchNumSet = searchNums.stream().map(s -> s.split("-")[0] + '-').distinct().collect(Collectors.toSet());
|
||||
Set<String> searchNumSet = searchNums.stream().map(s -> s.split("-")[0] + '-').collect(Collectors.toSet());
|
||||
LambdaQueryWrapper<PollingTask> topSql = WrapperUtils.builder(commonParam, commonParam);
|
||||
topSql.in(CollectionUtil.isNotEmpty(searchNumSet), PollingTask::getSearchNum, searchNumSet);
|
||||
List<PollingTask> topList = list(topSql);
|
||||
|
|
@ -250,7 +253,6 @@ public class PollingTaskServiceImpl extends ServiceImpl<PollingTaskMapper, Polli
|
|||
.last(Operator.LIMIT_ONE.getCharacter());
|
||||
return baseMapper.selectOne(taskSql);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Result<Boolean> importTask(String params)
|
||||
{
|
||||
|
|
@ -292,8 +294,10 @@ public class PollingTaskServiceImpl extends ServiceImpl<PollingTaskMapper, Polli
|
|||
List<PollingTask> queryList = list(taskSql);
|
||||
// 先通过名称和pid查询是否存在 存在直接返回id 不存在新增
|
||||
if(CollUtil.isEmpty(queryList)){
|
||||
map.put(name, saveTask(TaskDTO.builder().name(name).parentId(pid)
|
||||
.enabled(1).build()));
|
||||
map.put(name,
|
||||
SpringUtils.getBean(this.getClass()).saveTask(TaskDTO.builder().name(name).parentId(pid)
|
||||
.enabled(1).build())
|
||||
);
|
||||
}else{
|
||||
map.put(name,queryList.get(0).getId());
|
||||
}
|
||||
|
|
@ -304,7 +308,7 @@ public class PollingTaskServiceImpl extends ServiceImpl<PollingTaskMapper, Polli
|
|||
if (task.getParentId() != 0)
|
||||
{
|
||||
LambdaQueryWrapper<PollingTask> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PollingTask::getParentId, task.getParentId()).last(Operator.LIMIT_ONE.getCharacter());
|
||||
queryWrapper.eq(PollingTask::getId, task.getParentId()).last(Operator.LIMIT_ONE.getCharacter());
|
||||
PollingTask superiorTask = getOne(queryWrapper);
|
||||
// 获取上级
|
||||
Assert.notNull(superiorTask, "上级任务不存在");
|
||||
|
|
@ -337,6 +341,8 @@ public class PollingTaskServiceImpl extends ServiceImpl<PollingTaskMapper, Polli
|
|||
private TaskVO convert(PollingTask task){
|
||||
TaskVO taskVO = new TaskVO();
|
||||
BeanUtil.copyProperties(task,taskVO);
|
||||
taskVO.setTaskId(task.getId());
|
||||
taskVO.setTaskName(task.getName());
|
||||
return taskVO;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.chushang.common.core.web.AjaxResult;
|
|||
import com.chushang.common.log.annotation.SysLog;
|
||||
import com.chushang.common.log.enums.BusinessType;
|
||||
import com.chushang.inspection.project.dto.Delete;
|
||||
import com.chushang.inspection.project.service.TbTemplateService;
|
||||
import com.chushang.inspection.terminal.po.Store;
|
||||
import com.chushang.inspection.terminal.query.StoreQuery;
|
||||
import com.chushang.inspection.terminal.service.StoreService;
|
||||
|
|
@ -29,6 +30,8 @@ public class StoreController {
|
|||
|
||||
@Resource
|
||||
StoreService storeService;
|
||||
@Resource
|
||||
TbTemplateService tbTemplateService;
|
||||
|
||||
/**
|
||||
* 查询商户
|
||||
|
|
@ -89,6 +92,13 @@ public class StoreController {
|
|||
}
|
||||
|
||||
// todo 导入商户 read
|
||||
// todo 下载导入模板
|
||||
@SysLog(value = "导入模板", businessType = BusinessType.DOWNLOAD)
|
||||
@PostMapping("/down/template")
|
||||
// @RequiresPermissions("store:down:template")
|
||||
public AjaxResult downTemplate(@RequestParam(defaultValue = "") String templateAlias,
|
||||
@RequestParam(defaultValue = "") Long taskId)
|
||||
{
|
||||
return AjaxResult.success(tbTemplateService.getByAlias(templateAlias, taskId));
|
||||
}
|
||||
// todo 导入商户 save
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.chushang.inspection.terminal.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.chushang.common.mybatis.utils.PageResult;
|
||||
import com.chushang.inspection.project.po.Template;
|
||||
import com.chushang.inspection.terminal.po.Store;
|
||||
import com.chushang.inspection.terminal.query.StoreQuery;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
|
@ -16,4 +17,5 @@ public interface StoreService extends IService<Store>{
|
|||
PageResult pageList(StoreQuery query);
|
||||
|
||||
void upload(MultipartFile file, Long taskId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@ import com.chushang.common.mybatis.utils.PageResult;
|
|||
import com.chushang.common.mybatis.utils.WrapperUtils;
|
||||
import com.chushang.datascope.annotation.DataScope;
|
||||
import com.chushang.inspection.project.po.PollingTask;
|
||||
import com.chushang.inspection.project.po.Template;
|
||||
import com.chushang.inspection.project.service.PollingTaskService;
|
||||
import com.chushang.inspection.project.service.TbTemplateService;
|
||||
import com.chushang.inspection.terminal.po.Store;
|
||||
import com.chushang.inspection.terminal.query.StoreQuery;
|
||||
import com.chushang.inspection.terminal.service.StoreService;
|
||||
|
|
@ -34,6 +36,8 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
|||
|
||||
@Resource
|
||||
PollingTaskService taskService;
|
||||
@Resource
|
||||
TbTemplateService tbTemplateService;
|
||||
|
||||
|
||||
@Override
|
||||
|
|
@ -62,6 +66,7 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
|||
|
||||
}
|
||||
|
||||
|
||||
private List<StoreVO> convert(List<Store> records){
|
||||
List<StoreVO> storeVOS = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(records)){
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import cn.hutool.core.util.StrUtil;
|
|||
import com.chushang.common.core.web.AjaxResult;
|
||||
import com.chushang.common.log.annotation.SysLog;
|
||||
import com.chushang.common.log.enums.BusinessType;
|
||||
import com.chushang.inspection.ins.GeneratedInsFactory;
|
||||
import com.chushang.inspection.utils.TaskConfigUtils;
|
||||
import com.chushang.inspection.work.dto.WrkInfoDTO;
|
||||
import com.chushang.inspection.work.query.DispatchQuery;
|
||||
|
|
@ -15,10 +14,8 @@ import com.chushang.inspection.work.query.ReviewedQuery;
|
|||
import com.chushang.inspection.work.query.WrkAppQuery;
|
||||
import com.chushang.inspection.work.query.WrkInfoQuery;
|
||||
import com.chushang.inspection.work.service.WrkInfoService;
|
||||
import com.chushang.redis.annotation.AutoIdempotent;
|
||||
import com.chushang.security.annotation.RequiresPermissions;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.java.Log;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
|
@ -203,7 +200,6 @@ public class WrkInfoController {
|
|||
/**
|
||||
* 提交
|
||||
*/
|
||||
@AutoIdempotent
|
||||
@PostMapping("/submit")
|
||||
@RequiresPermissions("wrk:submit")
|
||||
@SysLog(value = "工单提交", businessType = BusinessType.INSERT)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
<dependency>
|
||||
<groupId>com.chushang</groupId>
|
||||
<artifactId>chushang-common-core</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
|
|
|
|||
Loading…
Reference in New Issue