合并优化

This commit is contained in:
15856 2024-07-15 17:15:20 +08:00
parent e38925a0cc
commit 7acb95c487
4 changed files with 13 additions and 7 deletions

View File

@ -276,7 +276,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_user su on pci.purchaser = su.user_id
LEFT JOIN sys_user us on us.user_id = tk.update_by
LEFT JOIN purchase_check_details pcd on pcd.task_id=pci.task_id
where task_type = 23 and tk.task_status in (26,28,105,106,107)
where task_type = 23
<if test="taskStatus != null"> and tk.task_status = #{taskStatus}</if>
<if test="taskStatus == null"> and tk.task_status in (28,105,106,107,122,123)</if>
<if test="keyWord != null and keyWord != ''">
and (tk.code like concat('%',#{keyWord},'%') or
su.user_name like concat('%',#{keyWord},'%')

View File

@ -5,6 +5,7 @@ import com.bonus.sgzb.system.config.ErrorCode;
import com.bonus.sgzb.system.domain.FileInfo;
import com.bonus.sgzb.system.service.SysFileService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.util.IOUtils;
import org.springframework.core.io.ResourceLoader;
import org.springframework.web.bind.annotation.GetMapping;
@ -25,6 +26,7 @@ import java.util.List;
/**
* @author bns
*/
@Slf4j
@RestController
@RequestMapping("/sys/file")
public class SysFileController {
@ -47,11 +49,12 @@ public class SysFileController {
FileInfo file = new FileInfo();
try {
file = service.uploadFile(request);
String suffix = file.getFileName().substring(file.getFileName().lastIndexOf(".") + 1);
if (! ATTACHMENT_FILE_SUFFIX.contains(suffix) || ! COST_FILE_SUFFIX.contains(suffix)) {
// String suffix = file.getFileName().substring(file.getFileName().lastIndexOf(".") + 1);
/* if (! ATTACHMENT_FILE_SUFFIX.contains(suffix) || ! COST_FILE_SUFFIX.contains(suffix)) {
return AjaxResult.error(ErrorCode.COMMISSION_BILL_ATTACHMENT_NOT_SUPPORT.getCode(),
ErrorCode.COMMISSION_BILL_ATTACHMENT_NOT_SUPPORT.getMessage());
}
}*/
if (limitWords != null && file.getWords() > Integer.parseInt(limitWords)){
return AjaxResult.error(ErrorCode.ATTACHMENT_UPLOAD_FAILED.getCode(),
ErrorCode.ATTACHMENT_UPLOAD_FAILED.getMessage());

View File

@ -68,7 +68,7 @@ public class SysFileServiceImpl implements SysFileService {
public FileInfo uploadFile(HttpServletRequest request) throws Exception {
FileInfo file = new FileInfo();
StandardMultipartHttpServletRequest req = (StandardMultipartHttpServletRequest) request;
String photoType = req.getParameter("fileType");
// String photoType = req.getParameter("fileType");
Long userId = SecurityUtils.getLoginUser().getUserid();
HashMap<String, Object> map = getFile(req);
List<MultipartFile> items = (List<MultipartFile>) map.get("filePath");
@ -84,6 +84,7 @@ public class SysFileServiceImpl implements SysFileService {
String type = fileName.substring(fileName.lastIndexOf(".") + 1);
long size = item.getSize() / 1024 / 1024;
file.setFileName(fileName);
log.info("文件名为:{}",fileName);
file.setFileUrl(url);
file.setCreator(userId.toString());
file.setType(type);

View File

@ -40,8 +40,8 @@
<select id="selectAll" resultMap="BaseResultMap">
select
bnl.id, bnl.model_title, bnl.`method`, bnl.task, bnl.type_id, bnl.num, bnl.`description`, bnl.json_result, bnl.`time`, bnl.creator,
bnl.remark, bnl.`status`, mt.type_name, mt1.type_name as type_parent_name, tt.code as task_name
bnl.id, bnl.model_title, bnl.`method`, bnl.task, bnl.type_id, bnl.`description`, bnl.json_result, bnl.`time`, bnl.creator,
bnl.remark, mt.type_name, mt1.type_name as type_parent_name, tt.code as task_name
from bm_num_logs bnl
left join ma_type mt on bnl.type_id = mt.type_id
inner join ma_type mt1 on mt.parent_id = mt1.type_id