材料站
This commit is contained in:
parent
6f21827607
commit
ec9578a99f
|
|
@ -456,36 +456,45 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
@Override
|
||||
public List<MaterialRetainedEquipmentInfo> getToolsLedgerList(MaterialRetainedEquipmentInfo bean) {
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
// 根据用户名判断用户是否为班组长
|
||||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (teamData == null) {
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) {
|
||||
bean.setProjectIdList(projectIdList);
|
||||
}
|
||||
}
|
||||
List<MaterialRetainedEquipmentInfo> list1 = new ArrayList<>();
|
||||
try {
|
||||
List<MaterialRetainedEquipmentInfo> totalList = materialMachineMapper.getToolsLedgerList(bean);
|
||||
//List<MaterialRetainedEquipmentInfo> totalList = materialMachineMapper.getToolsLedgerList(bean);
|
||||
List<MaterialRetainedEquipmentInfo> list = materialMachineMapper.getRetainedEquipmentList(bean);
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
if (!CollectionUtils.isEmpty(totalList) && deptId != null) {
|
||||
/*if (!CollectionUtils.isEmpty(totalList) && deptId != null) {
|
||||
// 删除元素
|
||||
totalList.removeIf(m -> !deptId.toString().equals(m.getImpUnit()));
|
||||
}
|
||||
if (CollectionUtils.isEmpty(totalList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
// 根据用户名判断用户是否为班组长
|
||||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
}*/
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(list)) {
|
||||
if (teamData != null) {
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
list = list.stream()
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
} /*else {
|
||||
list = filterInfoTools(list, username);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
// 根据用户名判断用户是否为班组长
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
list1 = groupByThirdTypeId(list);
|
||||
} else if (CollectionUtils.isNotEmpty(totalList)) {
|
||||
} /*else if (CollectionUtils.isNotEmpty(totalList)) {
|
||||
list1 = groupByThirdTypeId(totalList);
|
||||
}
|
||||
}*/
|
||||
return list1;
|
||||
} catch (Exception e){
|
||||
log.error("获取设备台账列表失败,参数:{}", bean, e);
|
||||
|
|
@ -562,9 +571,9 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
return getMaterialRetainedEquipmentInfo(list);
|
||||
}
|
||||
} else {
|
||||
} /*else {
|
||||
primaryList = filterInfo(primaryList, username);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
if (!CollectionUtil.isEmpty(primaryList)) {
|
||||
return getMaterialRetainedEquipmentInfo(primaryList);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.bonus.material.common.service.SelectService;
|
|||
import com.bonus.material.materialStation.domain.ProAuthorizeInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
|
@ -20,6 +21,7 @@ import javax.annotation.Resource;
|
|||
@Api(tags = "统一下拉选接口")
|
||||
@RestController
|
||||
@RequestMapping("/select/")
|
||||
@Slf4j
|
||||
public class SelectController {
|
||||
|
||||
@Resource(name = "SelectService")
|
||||
|
|
@ -64,7 +66,12 @@ public class SelectController {
|
|||
@ApiOperation(value = "工程下拉选")
|
||||
@PostMapping("getProjectList")
|
||||
public AjaxResult getProjectList(@RequestBody BmProject bmProject) {
|
||||
return service.getProjectList(bmProject);
|
||||
try {
|
||||
return service.getProjectList(bmProject);
|
||||
} catch (Exception e) {
|
||||
log.error("获取数据失败");
|
||||
return AjaxResult.error("获取数据失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "机具类型下拉选")
|
||||
|
|
@ -207,6 +214,11 @@ public class SelectController {
|
|||
@ApiOperation(value = "工程下拉选")
|
||||
@PostMapping("getProjectInfo")
|
||||
public AjaxResult getProjectInfo(@RequestBody BmProject bmProject) {
|
||||
return service.getProjectInfo(bmProject);
|
||||
try {
|
||||
return service.getProjectInfo(bmProject);
|
||||
} catch (Exception e) {
|
||||
log.error("获取工程信息异常", e);
|
||||
return AjaxResult.error("获取工程信息异常");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -409,7 +409,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
GROUP_CONCAT(DISTINCT mt1.type_name) as maTypeNames,
|
||||
tt.task_type as taskType,
|
||||
bp.external_id AS externalId,
|
||||
bu.bzz_idcard AS idCard
|
||||
bu.bzz_idcard AS idCard,
|
||||
bp.imp_unit AS impUnit
|
||||
from
|
||||
lease_apply_info lai
|
||||
left join tm_task tt on lai.task_id = tt.task_id
|
||||
|
|
@ -991,7 +992,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
lpd.lease_sign_type AS leaseSignType,
|
||||
tt.task_type AS taskType,
|
||||
bp.external_id AS externalId,
|
||||
bu.bzz_idcard AS idCard
|
||||
bu.bzz_idcard AS idCard,
|
||||
bp.imp_unit AS impUnit
|
||||
FROM
|
||||
lease_publish_details lpd
|
||||
LEFT JOIN lease_apply_info lai ON lai.id = lpd.parent_id
|
||||
|
|
|
|||
|
|
@ -418,6 +418,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and (mt2.type_name like concat('%',#{keyWord},'%')
|
||||
OR mt.type_name like concat('%',#{keyWord},'%') )
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
and subquery1.externalId in
|
||||
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
mt.type_id
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue