Commit eff9e3eb by jiangxuming

feat: 孙主任提的导出表

parent 2f8c62b5
...@@ -645,6 +645,21 @@ public class EntrustSampleController extends ServiceController { ...@@ -645,6 +645,21 @@ public class EntrustSampleController extends ServiceController {
return success(entrustSampleService.getAlGradeStatsQuery(statsQueryDTO)); return success(entrustSampleService.getAlGradeStatsQuery(statsQueryDTO));
} }
@ApiOperation("导出原铝台账(总厂)")
@PostMapping("/labor_hour_statistics_table")
public void laborHourStatisticsTable(StatsQueryDTO statsQueryDTO) {
entrustSampleService.laborHourStatisticsTable(statsQueryDTO,response);
}
@ApiOperation("导出原铝台账(总厂)")
@PostMapping("/labor_hour_statistics_table_sub")
public void laborHourStatisticsTableSub(StatsQueryDTO statsQueryDTO) {
entrustSampleService.laborHourStatisticsTableSub(statsQueryDTO,response);
}
@ApiOperation("电解质分子比统计查询") @ApiOperation("电解质分子比统计查询")
@PostMapping("/electrolyte_ratio_stats_query") @PostMapping("/electrolyte_ratio_stats_query")
public RestResult<List<ElectrolyteRatioStatsVO>> getElectrolyteRatioStatsQuery(QueryDTO queryDTO) { public RestResult<List<ElectrolyteRatioStatsVO>> getElectrolyteRatioStatsQuery(QueryDTO queryDTO) {
......
...@@ -587,6 +587,13 @@ public class EntrustSampleItemController extends ServiceController { ...@@ -587,6 +587,13 @@ public class EntrustSampleItemController extends ServiceController {
return success(entrustSampleItemService.deviatePass(ids, getAccount())); return success(entrustSampleItemService.deviatePass(ids, getAccount()));
} }
@Login(action = Action.Skip)
@ApiOperation("外部查询,供SAP系统查询")
@PostMapping("/get_data")
public RestResult<List<EntrustSampleItemVO>> getData(EntrustSampleItemVO entrustSampleItem) {
return success(entrustSampleItemService.getData(entrustSampleItem));
}
@ApiOperation("偏离审批驳回") @ApiOperation("偏离审批驳回")
@PostMapping("/deviate_back") @PostMapping("/deviate_back")
......
...@@ -91,5 +91,6 @@ public interface EntrustSampleItemMapper extends BatchMapper<EntrustSampleItem> ...@@ -91,5 +91,6 @@ public interface EntrustSampleItemMapper extends BatchMapper<EntrustSampleItem>
Integer deletePhysicalByEntrustIds(@Param("entrustIds") List<Long> entrustIds); Integer deletePhysicalByEntrustIds(@Param("entrustIds") List<Long> entrustIds);
@SqlParser(filter = true)
List<EntrustSampleItemVO> getData(@Param("vo") EntrustSampleItemVO vo);
} }
...@@ -54,4 +54,6 @@ public interface EntrustSampleMapper extends BatchMapper<EntrustSample> { ...@@ -54,4 +54,6 @@ public interface EntrustSampleMapper extends BatchMapper<EntrustSample> {
int isRepeatSampleCode(@Param("vo") EntrustSample sample); int isRepeatSampleCode(@Param("vo") EntrustSample sample);
Integer deletePhysicalByEntrustIds(@Param("entrustIds") List<Long> entrustIds); Integer deletePhysicalByEntrustIds(@Param("entrustIds") List<Long> entrustIds);
List<EntrustSampleItemVO> laborHourStatisticsTable(@Param("dto") StatsQueryDTO queryDTO);
} }
...@@ -141,4 +141,6 @@ public interface IEntrustSampleItemService extends IBaseService<EntrustSampleIte ...@@ -141,4 +141,6 @@ public interface IEntrustSampleItemService extends IBaseService<EntrustSampleIte
boolean deletePhysicalByEntrustIds(List<Long> ids); boolean deletePhysicalByEntrustIds(List<Long> ids);
Boolean sendErpData(List<Long> entrustIds); Boolean sendErpData(List<Long> entrustIds);
List<EntrustSampleItemVO> getData(EntrustSampleItemVO entrustSampleItem);
} }
...@@ -68,6 +68,9 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> { ...@@ -68,6 +68,9 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
List<AlGradeStatsVO> getAlGradeStatsQuery(StatsQueryDTO queryDTO); List<AlGradeStatsVO> getAlGradeStatsQuery(StatsQueryDTO queryDTO);
void laborHourStatisticsTable(StatsQueryDTO queryDTO, HttpServletResponse response);
void laborHourStatisticsTableSub(StatsQueryDTO queryDTO, HttpServletResponse response);
List<ElectrolyteRatioStatsVO> getElectrolyteRatioStatsQuery(QueryDTO queryDTO); List<ElectrolyteRatioStatsVO> getElectrolyteRatioStatsQuery(QueryDTO queryDTO);
Map<String, Object> getPMakeFeStatsQuery(QueryDTO queryDTO); Map<String, Object> getPMakeFeStatsQuery(QueryDTO queryDTO);
......
...@@ -1817,6 +1817,11 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI ...@@ -1817,6 +1817,11 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
return false; return false;
} }
@Override
public List<EntrustSampleItemVO> getData(EntrustSampleItemVO entrustSampleItem) {
return baseMapper.getData(entrustSampleItem);
}
private String getCellValue(XSSFRow xssfRow, int cellIndex) { private String getCellValue(XSSFRow xssfRow, int cellIndex) {
XSSFCell cell = xssfRow.getCell(cellIndex); XSSFCell cell = xssfRow.getCell(cellIndex);
String value = HSSFWorkbookUtil.getJavaValue(cell).toString(); String value = HSSFWorkbookUtil.getJavaValue(cell).toString();
......
...@@ -803,6 +803,36 @@ ...@@ -803,6 +803,36 @@
</if> </if>
order by e.code, i.name, s.code order by e.code, i.name, s.code
</select> </select>
<select id="getData" resultType="com.patzn.cloud.service.hmhj.vo.EntrustSampleItemVO">
SELECT
i.name,
s.slot_no,
s.sample_from,
ii.test_value,
i.test_time,
i.*,
s.*,
e.*
FROM
entrust_sample_item_index ii
join entrust_sample_item i on ii.entrust_sample_item_id = i.id
JOIN entrust_sample s ON i.entrust_sample_id = s.ID
JOIN entrust e ON s.entrust_id = e.ID
where s.deleted = 0
AND i.deleted = 0 and e.deleted = 0 and ii.deleted = 0
ANd i.name = '电解质分子比' and i.status > 49
<if test="null != vo.slotNo">
AND s.slot_no LIKE CONCAT ('%',#{vo.slotNo},'%')
</if>
<if test="null != vo.sampleFrom">
AND s.sample_from LIKE CONCAT ('%',#{vo.sampleFrom},'%')
</if>
<if test="vo.testTimeBegin != null and vo.testTimeEnd != null">
AND date_trunc('day',i.test_time) between #{vo.testTimeBegin} and #{vo.testTimeEnd}
</if>
order by i.test_time desc
LIMIT 1000
</select>
<update id="updateBatchByData" parameterType="java.util.List"> <update id="updateBatchByData" parameterType="java.util.List">
<foreach collection="itemList" item="item" index="index" open="" close="" separator=";"> <foreach collection="itemList" item="item" index="index" open="" close="" separator=";">
......
...@@ -517,6 +517,26 @@ ...@@ -517,6 +517,26 @@
and s.id != #{vo.id} and s.id != #{vo.id}
</if> </if>
</select> </select>
<select id="laborHourStatisticsTable" resultType="com.patzn.cloud.service.hmhj.vo.EntrustSampleItemVO">
SELECT
EXTRACT(DAY FROM s.ctime) AS day,
s.sample_grading,
slot_no ,
i.name,
ii.test_value
FROM
"entrust_sample" s join entrust_sample_item i on i.entrust_sample_id = s.id join entrust_sample_item_index ii on ii.entrust_sample_item_id = i.id
WHERE
s.NAME IN ( '原铝', '原铝重取' )
AND s.ctime > date_trunc('month', CURRENT_DATE)
AND s.ctime &lt; date_trunc('month', CURRENT_DATE) + INTERVAL '1 month'
AND CAST(TRIM(slot_no) AS INTEGER) >= 1001
AND CAST(TRIM(slot_no) AS INTEGER) &lt;= 7000
ORDER BY
s.name desc,
s.ctime,
s.slot_no
</select>
<update id="updateBatchByData" parameterType="java.util.List"> <update id="updateBatchByData" parameterType="java.util.List">
<foreach collection="sampleList" item="item" index="index" open="" close="" separator=";"> <foreach collection="sampleList" item="item" index="index" open="" close="" separator=";">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment