chenlu
2024-05-22 5d52238c506c6a819ace4413b6f1cfd2247cfbd2
提交拉取
5个文件已修改
53 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/pp/report/CrossProcessBreaking.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/Report.xml 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/report/CrossProcessBreaking.vue
@@ -20,6 +20,8 @@
  ],//表格表头字段
  data:[],//表格数据
  url :'/report/crossProcessBreaking',
  exportUrl :'/report/exportCrossProcessBreaking',
  exportName:'跨工序次破报表',
  footList:['quantity','grossArea','computeGrossArea','perimeter','price','grossAmount']
})
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportController.java
@@ -6,17 +6,22 @@
import com.example.erp.entity.pp.DamageDetails;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.pp.Report;
import com.example.erp.entity.sd.Order;
import com.example.erp.entity.sd.OrderDetail;
import com.example.erp.entity.sd.OrderGlassDetail;
import com.example.erp.exception.ServiceException;
import com.example.erp.service.pp.ReportService;
import com.example.erp.service.pp.WorkOrderService;
import com.example.erp.tools.DownExcel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.Date;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
@@ -153,4 +158,11 @@
                                         @RequestBody Report report){
        return Result.seccess(reportService.rawMaterialRequisitionSv(selectTime1,selectTime2,report));
    }
    @ApiOperation("跨工序次破报表导出")
    @PostMapping("/exportCrossProcessBreaking")
    public void exportCrossProcessBreaking(HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException {
        //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字
        DownExcel.download(response, DamageDetails.class, reportService.exportCrossProcessBreakingSv(dates),"CrossProcessBreaking");
    }
}
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportMapper.java
@@ -3,10 +3,12 @@
import com.example.erp.entity.pp.DamageDetails;
import com.example.erp.entity.pp.Report;
import com.example.erp.entity.sd.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.sql.Date;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
@@ -43,6 +45,8 @@
    List<Map<String, String>> rawMaterialRequisitionMp(Date selectTime1, Date selectTime2, Report report);
    List<DamageDetails> exportCrossProcessBreakingMp(List<LocalDate> dates);
//    Map<String, Integer> getWorkInProgressTotal(
//                                                @Param("selectTime1") Date selectTime1, @Param("selectTime2") Date selectTime2,
//                                                @Param("orderId") String orderId, @Param("inputProject") String inputProject,
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java
@@ -329,4 +329,8 @@
        map.put("data",reportMapper.rawMaterialRequisitionMp( selectTime1,selectTime2,report));
        return map;
    }
    public List exportCrossProcessBreakingSv(List<LocalDate> dates) {
        return reportMapper.exportCrossProcessBreakingMp(dates);
    }
}
north-glass-erp/src/main/resources/mapper/pp/Report.xml
@@ -670,4 +670,35 @@
        GROUP BY
            ou.width,ou.height,material_code
    </select>
    <select id="exportCrossProcessBreakingMp">
        select rw.reporting_work_id,
               rw.reporting_work_time,
               dd.responsible_process,
               dd.responsible_team,
               dd.breakage_type,
               dd.breakage_reason,
               ROUND((dd.breakage_quantity))                                                   as breakage_quantity,
               round(ogd.child_width * ogd.child_height * (dd.breakage_quantity) / 1000000, 2) as area,
               rw.this_process,
               o.project,
               o.order_id,
               ogd.glass_child
        from damage_details as dd
                 left join reporting_work as rw
                           on rw.reporting_work_id = dd.reporting_work_id
                 left join sd.order as o
                           on rw.order_id = o.order_id
                 left join sd.order_glass_detail as ogd
                           on ogd.order_id = o.order_id and ogd.order_number = dd.order_number
                               and ogd.technology_number and dd.technology_number
        where date(rw.reporting_work_time) >= #{dates[0]}
          and date(rw.reporting_work_time) &lt;= #{dates[1]}
          and rw.this_worn_quantity > 0
          and dd.available = 0
          and reviewed_state != 2
          and rw.this_process != dd.responsible_process
        GROUP BY dd.id
        order by dd.id desc
    </select>
</mapper>