add:需求单预览打印、导出EXCEL
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 >= #{query.startTime}
|
||||
</if>
|
||||
<if test="query.endTime != null and query.endTime != ''">
|
||||
and d.create_time <= #{query.endTime}
|
||||
</if>
|
||||
order by d.create_time desc, d.work_order, d.priority desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user