| | |
| | | for(WorkorderRecordExtListVO model : result){ |
| | | //查询生产人员姓名 |
| | | initProUser(user,model,allDepartList); |
| | | // BigDecimal s =new BigDecimal(Constants.formatIntegerNum(model.getSalary())); |
| | | // s.divide(new BigDecimal(0),2); |
| | | // model.setSalary(s.doubleValue()); |
| | | } |
| | | } |
| | | return PageData.from(new PageInfo<>(result)); |
| | |
| | | unintname = re.getUmodel().getName(); |
| | | } |
| | | if (re.getPmodel() != null) { |
| | | Integer pmodelnum = re.getPmodel().getNum() != null ? re.getPmodel().getNum() : 0; |
| | | BigDecimal pmodelnum = re.getNum() != null ? re.getNum() : new BigDecimal("0"); |
| | | // wreev.setPlanNum( new BigDecimal(pmodelnum).stripTrailingZeros().toPlainString() + unintname); |
| | | wreev.setPlanNum( new BigDecimal(pmodelnum).stripTrailingZeros().toPlainString() ); |
| | | } |
| | | if (re.getDoneType() != null) { |
| | | switch (re.getDoneType()) { |
| | | case 0: |
| | | wreev.setDoneType("合格"); |
| | | break; |
| | | case 1: |
| | | wreev.setDoneType("不良"); |
| | | break; |
| | | case 2: |
| | | wreev.setDoneType("报废"); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | wreev.setPlanNum( re.getNum().stripTrailingZeros().toPlainString()+unintname); |
| | | } |
| | | wreev.setProcedureName(re.getProcedureName()); |
| | | wreev.setUnintname(unintname); |
| | | if(re.getNum()!=null){ |
| | | wreev.setAppliancenum(re.getNum().stripTrailingZeros().toPlainString() ); |
| | | wreev.setAppliancenum(re.getNum().stripTrailingZeros().toPlainString()+unintname ); |
| | | } |
| | | |
| | | wreev.setUnintname(unintname); |
| | | |
| | | if (re.getAmodel() != null) { |
| | | wreev.setAppliancecode(re.getAmodel().getCode()); |
| | | } |
| | | |
| | | wreev.setDeviceCode(re.getDeviceCode()+"|"+re.getDeviceName()); |
| | | wreev.setCreateTime(format.format(re.getCreateTime())); |
| | | wreev.setQualifiedNum( (Objects.nonNull(re.getQualifiedNum()) ? re.getQualifiedNum() : 0)+unintname); |
| | | wreev.setUnqualifiedNum((Objects.nonNull(re.getUnqualifiedNum()) ? re.getUnqualifiedNum() : 0)+unintname); |
| | | Integer duration = re.getDuration(); |
| | | if (Objects.nonNull(duration)){ |
| | | Integer h = duration/3600; |
| | | Integer m = (duration%3600)/60; |
| | | Integer s = ((duration%3600)%60); |
| | | wreev.setDuration(h+"小时"+m+"分钟"+s+"秒"); |
| | | }else { |
| | | wreev.setDuration("-"); |
| | | } |
| | | wreev.setSalaryType(re.getSalaryType()); |
| | | wreev.setSalaryPrice(re.getSalary()); |
| | | list.add(wreev); |
| | | |
| | | } |
| | | ExcelExporter.build(WorkorderRecordExportExtListVO.class).export(list, "工单生产过程记录"+System.currentTimeMillis(), response); |
| | | ExcelExporter.build(WorkorderRecordExportExtListVO.class).export(list, "生产产出明细"+System.currentTimeMillis(), response); |
| | | |
| | | // EasyExcelUtil.exportExcel(list, "工单生产过程记录","工单生产过程记录",WorkorderRecordExportExtListVO.class,"工单生产过程记录"+System.currentTimeMillis()+".xls", response); |
| | | } |
| | | |
| | | @Override |
| | | public void exportExcel2(PageWrap<QueryWorkorderRecordExtDTO> pageWrap, HttpServletResponse response) { |
| | | |
| | | List<WorkorderRecordExtListVO> result=this.findPage(pageWrap).getRecords(); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | List<WorkorderRecordBathExportExtListVO> list=new ArrayList<>(); |
| | | for(int i=0;i<result.size();i++) { |
| | | WorkorderRecordExtListVO re = result.get(i); |
| | | WorkorderRecordBathExportExtListVO wreev = new WorkorderRecordBathExportExtListVO(); |
| | | if (re.getOmodel() != null) { |
| | | wreev.setWorkordercode(re.getOmodel().getCode()); |
| | | if (re.getOmodel().getStatus() != null) { |
| | | String status = Constants.WORKORDER_STATUS.getTitleByStatus(null, re.getOmodel().getStatus()); |
| | | wreev.setStatus(status); |
| | | } |
| | | } |
| | | if (re.getMmodel() != null) { |
| | | wreev.setMaterialcode(re.getMmodel().getCode()); |
| | | wreev.setMaterialname(re.getMmodel().getName()); |
| | | } |
| | | |
| | | wreev.setBatch(re.getBatch()); |
| | | if (re.getPromodel() != null) { |
| | | wreev.setProceduresname(re.getPromodel().getName()); |
| | | } |
| | | |
| | | String unintname = ""; |
| | | if (re.getUmodel() != null) { |
| | | unintname = re.getUmodel().getName(); |
| | | } |
| | | if (re.getNum() != null) { |
| | | BigDecimal pmodelnum = re.getNum() != null ? re.getNum() : new BigDecimal("0"); |
| | | // wreev.setPlanNum( new BigDecimal(pmodelnum).stripTrailingZeros().toPlainString() + unintname); |
| | | wreev.setNum( pmodelnum.stripTrailingZeros().toPlainString()+unintname); |
| | | } |
| | | wreev.setProcedureName(re.getProcedureName()); |
| | | wreev.setUnintname(unintname); |
| | | if(re.getOmodel().getPlanNum() != null){ |
| | | wreev.setPlanNum(re.getOmodel().getPlanNum().toString() ); |
| | | } |
| | | wreev.setMaterialDonetype(re.getMaterialDonetype()); |
| | | wreev.setDeviceCode(re.getDeviceCode()+"|"+re.getDeviceName()); |
| | | wreev.setCreateTime(format.format(re.getCreateTime())); |
| | | list.add(wreev); |
| | | |
| | | } |
| | | ExcelExporter.build(WorkorderRecordBathExportExtListVO.class).export(list, "生产投料明细"+System.currentTimeMillis(), response); |
| | | |
| | | } |
| | | } |