标签导出
This commit is contained in:
parent
886ae3c8d4
commit
c01b57d40a
|
|
@ -122,7 +122,7 @@ public class LeaseApplyInfoController extends BaseController {
|
||||||
@PostMapping("/exportInfo")
|
@PostMapping("/exportInfo")
|
||||||
public void exportInfo(HttpServletResponse response, LeaseApplyInfo leaseApplyInfo) {
|
public void exportInfo(HttpServletResponse response, LeaseApplyInfo leaseApplyInfo) {
|
||||||
LeaseApplyRequestVo leaseApplyRequestVo = leaseApplyInfoService.getInfo(leaseApplyInfo.getId());
|
LeaseApplyRequestVo leaseApplyRequestVo = leaseApplyInfoService.getInfo(leaseApplyInfo.getId());
|
||||||
leaseApplyInfoService.exportInfo(leaseApplyRequestVo, response);
|
leaseApplyInfoService.exportInfo(leaseApplyInfo, leaseApplyRequestVo, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "导出领料任务详情")
|
@ApiOperation(value = "导出领料任务详情")
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,9 @@ public class LeaseOutVo {
|
||||||
@ApiModelProperty("任务id")
|
@ApiModelProperty("任务id")
|
||||||
private Long taskId;
|
private Long taskId;
|
||||||
|
|
||||||
|
@ApiModelProperty("机具id")
|
||||||
|
private Long maId;
|
||||||
|
|
||||||
@ApiModelProperty("机具名称")
|
@ApiModelProperty("机具名称")
|
||||||
private String typeName;
|
private String typeName;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ public interface LeaseApplyDetailsMapper {
|
||||||
* @param maId
|
* @param maId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<LeaseOutVo> selectByMaId(Long maId);
|
List<LeaseOutVo> selectByMaId(@Param("maId") Long maId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据领料任务id查询领料任务详细
|
* 根据领料任务id查询领料任务详细
|
||||||
|
|
|
||||||
|
|
@ -111,10 +111,11 @@ public interface ILeaseApplyInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出领料出库详细
|
* 导出领料出库详细
|
||||||
|
* @param leaseApplyInfo
|
||||||
* @param leaseApplyRequestVo
|
* @param leaseApplyRequestVo
|
||||||
* @param response
|
* @param response
|
||||||
*/
|
*/
|
||||||
void exportInfo(LeaseApplyRequestVo leaseApplyRequestVo, HttpServletResponse response);
|
void exportInfo(LeaseApplyInfo leaseApplyInfo, LeaseApplyRequestVo leaseApplyRequestVo, HttpServletResponse response);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询内部领料任务详情
|
* 根据id查询内部领料任务详情
|
||||||
|
|
|
||||||
|
|
@ -704,7 +704,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exportInfo(LeaseApplyRequestVo leaseApplyRequestVo, HttpServletResponse response) {
|
public void exportInfo(LeaseApplyInfo leaseApplyInfo, LeaseApplyRequestVo leaseApplyRequestVo, HttpServletResponse response) {
|
||||||
try {
|
try {
|
||||||
String fileName = "施工机具设备出库检验记录表";
|
String fileName = "施工机具设备出库检验记录表";
|
||||||
String projectName = "";
|
String projectName = "";
|
||||||
|
|
@ -714,6 +714,12 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
projectName ="领用工程:" + leaseApplyRequestVo.getLeaseApplyInfo().getLeaseProject();
|
projectName ="领用工程:" + leaseApplyRequestVo.getLeaseApplyInfo().getLeaseProject();
|
||||||
unit ="使用单位:" + leaseApplyRequestVo.getLeaseApplyInfo().getLeaseUnit();
|
unit ="使用单位:" + leaseApplyRequestVo.getLeaseApplyInfo().getLeaseUnit();
|
||||||
list = leaseApplyRequestVo.getLeaseOutVoList();
|
list = leaseApplyRequestVo.getLeaseOutVoList();
|
||||||
|
if (leaseApplyInfo.getMaId() != null) {
|
||||||
|
// 过滤出list中和leaseApplyInfo.getMaId()相等的元素
|
||||||
|
list = list.stream()
|
||||||
|
.filter(item -> item.getMaId().equals(leaseApplyInfo.getMaId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
expOutExcel(response,list,fileName,projectName,unit);
|
expOutExcel(response,list,fileName,projectName,unit);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,9 @@ public class Machine extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键id */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
/** 机具ID */
|
/** 机具ID */
|
||||||
private Long maId;
|
private Long maId;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -214,6 +214,12 @@ public class MachineServiceImpl implements IMachineService
|
||||||
dto.setIsJj(1);
|
dto.setIsJj(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 获取领料单详情
|
||||||
|
List<LeaseOutVo> details = leaseApplyDetailsMapper.selectByMaId(dto.getMaId());
|
||||||
|
if (CollectionUtils.isNotEmpty(details)) {
|
||||||
|
Long id = details.get(0).getId();
|
||||||
|
dto.setId(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
|
|
||||||
|
|
@ -297,6 +297,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
mt.type_name AS typeModelName,
|
mt.type_name AS typeModelName,
|
||||||
mt.unit_name AS unit,
|
mt.unit_name AS unit,
|
||||||
lod.out_num AS num,
|
lod.out_num AS num,
|
||||||
|
lod.ma_id AS maId,
|
||||||
mm.ma_code AS maCode,
|
mm.ma_code AS maCode,
|
||||||
mt.rated_load AS ratedLoad,
|
mt.rated_load AS ratedLoad,
|
||||||
mt.test_load AS testLoad,
|
mt.test_load AS testLoad,
|
||||||
|
|
@ -406,9 +407,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id
|
LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id
|
||||||
LEFT JOIN lease_apply_details lad ON lod.type_id = lad.type_id
|
LEFT JOIN lease_apply_details lad ON lod.type_id = lad.type_id
|
||||||
LEFT JOIN purchase_check_details pcd ON lod.type_id = pcd.type_id
|
LEFT JOIN purchase_check_details pcd ON lod.type_id = pcd.type_id
|
||||||
<if test="userId != null">
|
|
||||||
JOIN ma_type_keeper mtk ON mtk.type_id = lod.type_id AND mtk.user_id = #{userId}
|
|
||||||
</if>
|
|
||||||
WHERE lod.ma_id = #{maId}
|
WHERE lod.ma_id = #{maId}
|
||||||
GROUP BY lod.type_id, mm.ma_code
|
GROUP BY lod.type_id, mm.ma_code
|
||||||
ORDER BY lod.create_time DESC
|
ORDER BY lod.create_time DESC
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue