update - add清单率报表
parent
43c2e012b3
commit
72614e6264
@ -0,0 +1,37 @@
|
||||
package com.aucma.report.controller;
|
||||
|
||||
import com.aucma.common.core.controller.BaseController;
|
||||
import com.aucma.common.core.domain.AjaxResult;
|
||||
import com.aucma.common.core.page.TableDataInfo;
|
||||
|
||||
import com.aucma.report.service.IProductionReportService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* PDA管理Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/report/productionReport")
|
||||
public class ProductionReportController extends BaseController {
|
||||
@Autowired
|
||||
private IProductionReportService productionReportService;
|
||||
|
||||
/**
|
||||
* 查询清单率报表
|
||||
*/
|
||||
@GetMapping("/inventoryRateReportList")
|
||||
public AjaxResult inventoryRateReportList(@RequestParam(required = false) Map hashMap) {
|
||||
List<HashMap<String, Object>> list = productionReportService.inventoryRateReportList(hashMap);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.aucma.report.mapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 通用报表Mapper接口
|
||||
*
|
||||
* @Author YinQ
|
||||
* @create 2023-10-26 10:53
|
||||
*/
|
||||
public interface GeneralReportMapper {
|
||||
|
||||
|
||||
/**
|
||||
* 查询清单率报表
|
||||
* @param hashMap
|
||||
* @return
|
||||
*/
|
||||
List<HashMap<String, Object>> inventoryRateReportList(Map hashMap);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.aucma.report.service;
|
||||
|
||||
import com.aucma.report.domain.BasePdaRecord;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* PDA管理Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-21
|
||||
*/
|
||||
public interface IProductionReportService
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询清单率报表
|
||||
*/
|
||||
List<HashMap<String, Object>> inventoryRateReportList(Map hashMap);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.aucma.report.service.impl;
|
||||
|
||||
import com.aucma.report.domain.BasePdaRecord;
|
||||
import com.aucma.report.mapper.GeneralReportMapper;
|
||||
import com.aucma.report.service.IProductionReportService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* PDA管理Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-21
|
||||
*/
|
||||
@Service
|
||||
public class ProductionReportServiceImpl implements IProductionReportService {
|
||||
@Autowired
|
||||
private GeneralReportMapper reportMapper;
|
||||
|
||||
/**
|
||||
* 查询清单率报表
|
||||
*/
|
||||
@Override
|
||||
public List<HashMap<String, Object>> inventoryRateReportList(Map hashMap) {
|
||||
return reportMapper.inventoryRateReportList(hashMap);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.aucma.report.mapper.GeneralReportMapper">
|
||||
|
||||
|
||||
<select id="inventoryRateReportList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
|
||||
SELECT boi.ORDER_CODE,
|
||||
boi.BEGIN_DATE,
|
||||
boi.MATERIAL_CODE,
|
||||
boi.MATERIAL_NAME,
|
||||
boi.ORDER_AMOUNT,
|
||||
NVL(boi.COMPLETE_AMOUNT, 0) COMPLETE_AMOUNT,
|
||||
ROUND(NVL(boi.COMPLETE_AMOUNT, 0) / boi.ORDER_AMOUNT, 2) * 100 || '%' ORDER_RATE,
|
||||
PL.WORK_CENTER_CODE,
|
||||
PL.PRODUCT_LINE_NAME
|
||||
FROM BASE_ORDERINFO boi
|
||||
LEFT JOIN BASE_PRODUCTLINE PL ON PL.WORK_CENTER_CODE = boi.WORK_CENTER_CODE
|
||||
WHERE boi.MATERIAL_CODE LIKE '90%'
|
||||
<if test="WORK_CENTER_CODE != null and WORK_CENTER_CODE != ''">
|
||||
AND boi.WORK_CENTER_CODE = #{WORK_CENTER_CODE}
|
||||
</if>
|
||||
<if test="MATERIAL_CODE != null and MATERIAL_CODE != ''">
|
||||
and boi.MATERIAL_CODE like concat(#{MATERIAL_CODE}, '%')
|
||||
</if>
|
||||
<if test="MATERIAL_NAME != null and MATERIAL_NAME != ''">
|
||||
and boi.MATERIAL_NAME like concat(concat('%',#{MATERIAL_NAME}), '%')
|
||||
</if>
|
||||
<if test="ORDER_CODE != null and ORDER_CODE != ''">
|
||||
and boi.ORDER_CODE like concat(concat('%',#{ORDER_CODE}), '%')
|
||||
</if>
|
||||
<if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''">
|
||||
AND TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BETWEEN #{beginBeginTime} AND #{endBeginTime}
|
||||
</if>
|
||||
ORDER BY ORDER_RATE
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue