代码提交
This commit is contained in:
parent
db86f585c0
commit
1450a2b5b1
|
|
@ -111,6 +111,9 @@ public class LeaseApplyInfo implements Serializable {
|
|||
@ApiModelProperty(value = "机具分公司审批时间")
|
||||
private String directAuditTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "机具分公司审批备注")
|
||||
private String directAuditRemark;
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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<TmTask> leaseAuditList = tmTaskService.getLeaseAuditList(task);
|
||||
if (task.getTypes() == 1) {
|
||||
|
|
|
|||
|
|
@ -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<TreeSelect> buildDeptTreeSelect(List<MaType> depts) {
|
||||
List<MaType> 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<MaType> buildDeptTree(List<MaType> maTypeList)
|
||||
{
|
||||
public List<MaType> buildDeptTree(List<MaType> maTypeList) {
|
||||
List<MaType> returnList = new ArrayList<MaType>();
|
||||
List<Long> 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<TreeSelect> buildDeptTreeSelect(List<MaType> depts)
|
||||
{
|
||||
List<MaType> 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<MaType> list, MaType t)
|
||||
{
|
||||
private void recursionFn(List<MaType> list, MaType t) {
|
||||
// 得到子节点列表
|
||||
List<MaType> 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<MaType> getChildList(List<MaType> list, MaType t)
|
||||
{
|
||||
private List<MaType> getChildList(List<MaType> list, MaType t) {
|
||||
List<MaType> tlist = new ArrayList<MaType>();
|
||||
Iterator<MaType> 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<MaType> list, MaType t)
|
||||
{
|
||||
private boolean hasChild(List<MaType> list, MaType t) {
|
||||
return getChildList(list, t).size() > 0 ? true : false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue