| | |
| | | ],//表格表头字段 |
| | | data:[],//表格数据 |
| | | url :'/report/crossProcessBreaking', |
| | | exportUrl :'/report/exportCrossProcessBreaking', |
| | | exportName:'跨工序次破报表', |
| | | footList:['quantity','grossArea','computeGrossArea','perimeter','price','grossAmount'] |
| | | }) |
| | | |
| | |
| | | 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; |
| | | |
| | |
| | | @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"); |
| | | } |
| | | } |
| | |
| | | |
| | | 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; |
| | | |
| | |
| | | |
| | | 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, |
| | |
| | | map.put("data",reportMapper.rawMaterialRequisitionMp( selectTime1,selectTime2,report)); |
| | | return map; |
| | | } |
| | | |
| | | public List exportCrossProcessBreakingSv(List<LocalDate> dates) { |
| | | return reportMapper.exportCrossProcessBreakingMp(dates); |
| | | } |
| | | } |
| | |
| | | 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) <= #{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> |