From 1450a2b5b15eb9a1552b43a318b9665316e075af Mon Sep 17 00:00:00 2001 From: "liang.chao" Date: Fri, 12 Jan 2024 17:07:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sgzb/base/api/domain/LeaseApplyInfo.java | 3 + .../sgzb/app/controller/TmTaskController.java | 2 +- .../base/service/impl/MaTypeServiceImpl.java | 67 ++++++++----------- 3 files changed, 31 insertions(+), 41 deletions(-) diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseApplyInfo.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseApplyInfo.java index a5238612..ae67e57c 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseApplyInfo.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseApplyInfo.java @@ -111,6 +111,9 @@ public class LeaseApplyInfo implements Serializable { @ApiModelProperty(value = "机具分公司审批时间") private String directAuditTime; + + @ApiModelProperty(value = "机具分公司审批备注") + private String directAuditRemark; /** * 创建者 */ diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/TmTaskController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/TmTaskController.java index cf934c8b..cb744e0d 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/TmTaskController.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/TmTaskController.java @@ -291,7 +291,7 @@ public class TmTaskController extends BaseController { */ @ApiOperation("领料申请/管理导出") @Log(title = "领料申请/管理导出", businessType = BusinessType.EXPORT) - @GetMapping("/applyExport") + @PostMapping("/applyExport") public void applyExport(HttpServletResponse response, TmTask task) { List leaseAuditList = tmTaskService.getLeaseAuditList(task); if (task.getTypes() == 1) { diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java index 5d3eb09f..9e8e6343 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java @@ -105,7 +105,7 @@ public class MaTypeServiceImpl implements ITypeService { int i = maTypeMapper.updateType(maType); // 图片路径保存 if (StringUtils.isNotEmpty(maType.getPhotoName()) && StringUtils.isNotEmpty(maType.getPhotoUrl())) { - typeFileMapper.deleteMaTypeFileByTypeId(typeId,"1"); + typeFileMapper.deleteMaTypeFileByTypeId(typeId, "1"); MaTypeFile typeFile = new MaTypeFile(); typeFile.setTypeId(typeId); typeFile.setFileName(maType.getPhotoName()); @@ -115,7 +115,7 @@ public class MaTypeServiceImpl implements ITypeService { } // 文档路径保存 if (StringUtils.isNotEmpty(maType.getDocumentName()) && StringUtils.isNotEmpty(maType.getDocumentUrl())) { - typeFileMapper.deleteMaTypeFileByTypeId(typeId,"2"); + typeFileMapper.deleteMaTypeFileByTypeId(typeId, "2"); MaTypeFile typeFile1 = new MaTypeFile(); typeFile1.setTypeId(typeId); typeFile1.setFileName(maType.getDocumentName()); @@ -183,7 +183,6 @@ public class MaTypeServiceImpl implements ITypeService { } - /** * 根据左列表类型id查询右表格 * @@ -260,6 +259,17 @@ public class MaTypeServiceImpl implements ITypeService { } + /** + * 构建前端所需要下拉树结构 + * + * @param depts 部门列表 + * @return 下拉树结构列表 + */ + @Override + public List buildDeptTreeSelect(List depts) { + List deptTrees = buildDeptTree(depts); + return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); + } /** * 构建前端所需要树结构 @@ -268,42 +278,26 @@ public class MaTypeServiceImpl implements ITypeService { * @return 树结构列表 */ @Override - public List buildDeptTree(List maTypeList) - { + public List buildDeptTree(List maTypeList) { List returnList = new ArrayList(); List tempList = maTypeList.stream().map(MaType::getTypeId).collect(Collectors.toList()); - for (MaType maType : maTypeList) - { + for (MaType maType : maTypeList) { // 如果是顶级节点, 遍历该父节点的所有子节点 - if (!tempList.contains(maType.getParentId())) - { + if (!tempList.contains(maType.getParentId())) { recursionFn(maTypeList, maType); returnList.add(maType); } } - if (returnList.isEmpty()) - { + if (returnList.isEmpty()) { returnList = maTypeList; } return returnList; } - /** - * 构建前端所需要下拉树结构 - * - * @param depts 部门列表 - * @return 下拉树结构列表 - */ - @Override - public List buildDeptTreeSelect(List depts) - { - List deptTrees = buildDeptTree(depts); - return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); - } - /** * 根据组织树parent_id查询结果 - * @param typeId 父级id + * + * @param typeId 父级id * @param typeName 名称筛选 * @return */ @@ -314,6 +308,7 @@ public class MaTypeServiceImpl implements ITypeService { /** * 查询工器具类型四级组织树 + * * @param typeId * @param typeName * @return @@ -363,34 +358,27 @@ public class MaTypeServiceImpl implements ITypeService { /** * 递归列表 */ - private void recursionFn(List list, MaType t) - { + private void recursionFn(List list, MaType t) { // 得到子节点列表 List childList = getChildList(list, t); t.setChildren(childList); - for (MaType tChild : childList) - { - if (hasChild(list, tChild)) - { + for (MaType tChild : childList) { + if (hasChild(list, tChild)) { recursionFn(list, tChild); } } } - /** * 得到子节点列表 */ - private List getChildList(List list, MaType t) - { + private List getChildList(List list, MaType t) { List tlist = new ArrayList(); Iterator it = list.iterator(); - while (it.hasNext()) - { + while (it.hasNext()) { MaType n = (MaType) it.next(); - if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getTypeId().longValue()) - { + if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getTypeId().longValue()) { tlist.add(n); } } @@ -401,8 +389,7 @@ public class MaTypeServiceImpl implements ITypeService { /** * 判断是否有子节点 */ - private boolean hasChild(List list, MaType t) - { + private boolean hasChild(List list, MaType t) { return getChildList(list, t).size() > 0 ? true : false; } }