add:需求单预览打印、导出EXCEL

This commit is contained in:
zhaoyf
2026-10-12 17:54:32 +08:00
parent 8e2d609631
commit fe598f54a4
7 changed files with 165 additions and 8 deletions

View File

@@ -31,6 +31,12 @@ public class PmDemandController {
return ResponseData.build(pmDemandService.queryPage(query, page), HttpStatus.OK);
}
@GetMapping("/exportList")
@Log("导出需求单")
public ResponseEntity<Object> exportList(PmDemandQuery query) {
return ResponseData.build(pmDemandService.queryExportList(query), HttpStatus.OK);
}
@PostMapping
@Log("新增需求单")
public ResponseEntity<Object> create(@Valid @RequestBody PmDemandParam param) {

View File

@@ -16,6 +16,8 @@ public interface IPmDemandService extends IService<PmDemand> {
Page<PmDemandDto> queryPage(PmDemandQuery query, PageQuery pageQuery);
List<PmDemandDto> queryExportList(PmDemandQuery query);
void create(PmDemandParam param);
void batchCreate(List<PmDemandParam> param);

View File

@@ -10,5 +10,7 @@ import java.util.List;
public interface PmDemandMapper extends BaseMapper<PmDemand> {
List<PmDemandDto> queryExportList(@Param("query") PmDemandQuery query);
List<PmDemandDto> queryPage(@Param("query") PmDemandQuery query);
}

View File

@@ -66,4 +66,44 @@
</if>
order by d.create_time desc,d.work_order,d.priority desc
</select>
<select id="queryExportList" resultMap="DemandDtoMap">
select d.*
from pm_demand d
where 1 = 1
<if test="query.status == 90">
and d.is_deleted = 1
</if>
<if test="query.status != 90">
and d.is_deleted = 0
</if>
<if test="query.id != null and query.id != ''">
and d.id = #{query.id}
</if>
<if test="query.creator != null and query.creator != ''">
and d.creator like concat('%', #{query.creator}, '%')
</if>
<if test="query.status != null">
and d.status = #{query.status}
</if>
<if test="query.workOrder != null and query.workOrder != ''">
and d.work_order like concat('%', #{query.workOrder}, '%')
</if>
<if test="query.skuCode != null and query.skuCode != ''">
and (d.sku_code like concat('%', #{query.skuCode}, '%') or d.sku_name like concat('%', #{query.skuCode}, '%'))
</if>
<if test="query.productionLine != null and query.productionLine != ''">
and d.production_line like concat('%', #{query.productionLine}, '%')
</if>
<if test="query.targetArea != null and query.targetArea != ''">
and d.target_area like concat('%', #{query.targetArea}, '%')
</if>
<if test="query.startTime != null and query.startTime != ''">
and d.create_time &gt;= #{query.startTime}
</if>
<if test="query.endTime != null and query.endTime != ''">
and d.create_time &lt;= #{query.endTime}
</if>
order by d.create_time desc, d.work_order, d.priority desc
</select>
</mapper>

View File

@@ -123,6 +123,12 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
return dtoPage;
}
@Override
public List<PmDemandDto> queryExportList(PmDemandQuery query) {
trimStringFields(query);
return baseMapper.queryExportList(query);
}
@Override
public void create(PmDemandParam param) {
PmDemand demand = new PmDemand();