chenlu
2024-11-06 a3dfc8966bb702c4ccb20f2a2afda7b7c39bd98d
north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java
@@ -4,6 +4,7 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.example.erp.dto.mm.FinishedOperateLogDTO;
import com.example.erp.entity.mm.*;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.pp.OptimizeUse;
@@ -755,6 +756,33 @@
        return map;
    }
    public Map<String, Object> getMaterialLogReport(String type,Integer pageNum, Integer pageSize, List<String> selectDate, MaterialLog materialLog) {
        Integer offset = (pageNum-1)*pageSize;
        String endDate = LocalDate.now().toString();
        String startDate = LocalDate.now().minusDays(15).toString();
        if(selectDate !=null && selectDate.size()==2){
            if(!selectDate.get(0).isEmpty()){
                startDate = selectDate.get(0);
            }
            if(!selectDate.get(1).isEmpty()){
                endDate = selectDate.get(1);
            }
        }
        Map<String, Object> map = new HashMap<>();
        map.put("data", materialInventoryMapper.getMaterialLogReport(offset, pageSize,startDate, endDate, materialLog,type));
        map.put("total", materialInventoryMapper.getMaterialLogReportTotal(offset, pageSize,startDate, endDate, materialLog,type));
        List<String> list = new ArrayList<>();
        list.add(startDate);
        list.add(endDate);
        map.put("selectDate",list);
        return map;
    }
    public List<MaterialLog> exportMaterialLogReport(List<LocalDate> dates, String type) {
        return materialInventoryMapper.exportMaterialLogReport(dates,type);
    }