| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * ç产设å¤ä¿¡æ¯æ¥å£ |
| | |
| | | find.setModel(device.getModel()); |
| | | find.setProcedureId(device.getProcedureId()); |
| | | find.setStationCode(device.getStationCode()); |
| | | find.setType(device.getType()); |
| | | find.setType(Objects.nonNull(device.getType()) ? device.getType() : Constants.ONE); |
| | | find.setGroupId(device.getGroupId()); |
| | | find.setProduceWarehouseLocationId(device.getProduceWarehouseLocationId()); |
| | | find.setFinishWarehouseLocationId(device.getFinishWarehouseLocationId()); |
| | |
| | | |
| | | |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @ApiOperation("ç产产åºå¯¼åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | // @RequiresPermissions("ext:workorderrecordext:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<QueryWorkorderRecordExtDTO> pageWrap, HttpServletResponse response) { |
| | | workorderRecordExtService.exportExcel(pageWrap,response); |
| | | } |
| | | |
| | | @ApiOperation("ç产ææå¯¼åºExcel") |
| | | @PostMapping("/exportExcelFeeding") |
| | | public void exportExcelFeeding(@RequestBody PageWrap<QueryWorkorderRecordExtDTO> pageWrap ,HttpServletResponse response){ |
| | | workorderRecordExtService.exportExcel2(pageWrap,response); |
| | | } |
| | | @ApiOperation("导åºå工绩ææç»") |
| | | @PostMapping("/exportUserSalary") |
| | | public void exportUserSalary (@RequestBody PageWrap<QueryUserSalaryListDTO> pageWrap, HttpServletResponse response) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package doumeemes.dao.ext.vo; |
| | | |
| | | import doumeemes.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author T14 |
| | | */ |
| | | @Data |
| | | @ApiModel("çäº§æææç»") |
| | | public class WorkorderRecordBathExportExtListVO { |
| | | |
| | | |
| | | @ApiModelProperty(value = "å·¥åç¼å·") |
| | | @ExcelColumn(name = "å·¥åç¼å·",index =1 ,width =15) |
| | | private String workordercode; |
| | | |
| | | @ApiModelProperty(value = "å·¥åç¶æ 0å·²å建ã1已夿ã2å·²å®å·¥ã3å·²æ£éªã4å·²æ¥å·¥ã5å·²å
¥åºã6已忶", example = "1") |
| | | @ExcelColumn(name="å·¥åç¶æ", index = 2,width =15) |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "ç¼ç ï¼ä¸å¯éå¤") |
| | | @ExcelColumn(name="ç©æç¼ç ",index =3,width =15) |
| | | private String materialcode; |
| | | |
| | | @ApiModelProperty(value = "åç§°ï¼ä¸å¯éå¤") |
| | | @ExcelColumn(name="ç©æåç§°",index =4,width =15) |
| | | private String materialname; |
| | | |
| | | @ApiModelProperty(value = "æ¹æ¬¡å·") |
| | | @ExcelColumn(name="çäº§æ¹æ¬¡å·",index =5,width =15) |
| | | private String batch; |
| | | |
| | | @ApiModelProperty(value = "å·¥åº") |
| | | @ExcelColumn(name="å·¥åº",index =6,width =15) |
| | | private String proceduresname; |
| | | |
| | | @ApiModelProperty(value = "è®¡åæ°é") |
| | | @ExcelColumn(name="è®¡åæ°é",index =7,width =15) |
| | | private String planNum; |
| | | |
| | | @ApiModelProperty(value = "åä½åç§°") |
| | | private String unitname; |
| | | |
| | | @ApiModelProperty(value = "ç产åå·¥") |
| | | @ExcelColumn(name="ç产åå·¥",index =8,width =15) |
| | | private String procedureName; |
| | | |
| | | @ApiModelProperty(value = "è´¨é屿§0åæ ¼ 1ä¸è¯ 2æ¥åºï¼åªætype=1ææå¼ï¼") |
| | | @ExcelColumn(name="è´¨é屿§",index = 9,width =15,valueMapping = "0=åæ ¼;1=ä¸è¯;2=æ¥åº") |
| | | private Integer materialDonetype; |
| | | |
| | | @ApiModelProperty(value = "æ°é", example = "1") |
| | | @ExcelColumn(name="æ°é",index = 10,width =15) |
| | | private String num; |
| | | |
| | | // @ExcelColumn(name="åä½",index =11,width =15) |
| | | private String unintname; |
| | | |
| | | |
| | | @ApiModelProperty(value = "设å¤") |
| | | @ExcelColumn(name="设å¤",index =11,width =15) |
| | | private String deviceCode; |
| | | |
| | | @ApiModelProperty(value = "æææ¶é´") |
| | | @ExcelColumn(name="æææ¶é´",index =12,width =15) |
| | | private String createTime; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "åä½åç§°") |
| | | private String unitname; |
| | | |
| | | /* @ApiModelProperty(value = "è®¡åæ°é") |
| | | @ExcelColumn(name="è®¡åæ°é",index =8) |
| | | private String procedurenum;*/ |
| | | |
| | | @ApiModelProperty(value = "ç产åå·¥") |
| | | @ExcelColumn(name="ç产åå·¥",index =8,width =15) |
| | | private String procedureName; |
| | | |
| | | @ApiModelProperty(value = "æ¥å·¥ç±»å0åæ ¼ 1ä¸è¯,2æ¥åºï¼åªætype=1ææå¼ï¼") |
| | | @ExcelColumn(name="æ¥å·¥ç±»å",index =9,width =15) |
| | | private String doneType; |
| | | @ApiModelProperty(value = "æ£éªåæ ¼æ°é", example = "1") |
| | | @ExcelColumn(name="æ£éªåæ ¼æ°é",index = 9,width =15) |
| | | private String qualifiedNum; |
| | | |
| | | @ApiModelProperty(value = "æ£éªä¸åæ ¼æ°é", example = "1") |
| | | @ExcelColumn(name="æ£éªä¸åæ ¼æ°é",index = 10,width =15) |
| | | private String unqualifiedNum; |
| | | |
| | | /* @ApiModelProperty(value = "è®¡åæ°é") |
| | | @ExcelColumn(name="è®¡åæ°é",index =8) |
| | | private String procedurenum;*/ |
| | | |
| | | |
| | | @ApiModelProperty(value = "æ°é") |
| | | @ExcelColumn(name="æ°é",index =10,width =15) |
| | | @ExcelColumn(name="æ¥å·¥æ°é",index =11,width =15) |
| | | private String appliancenum; |
| | | |
| | | @ApiModelProperty(value = "åä½") |
| | | @ExcelColumn(name="åä½",index =11,width =15) |
| | | // @ExcelColumn(name="åä½",index =11,width =15) |
| | | private String unintname; |
| | | |
| | | @ApiModelProperty(value = "å·¥è£
å¨å
·") |
| | | @ExcelColumn(name="å·¥è£
å¨å
·",index =12,width =15) |
| | | // @ApiModelProperty(value = "å·¥è£
å¨å
·") |
| | | // @ExcelColumn(name="å·¥è£
å¨å
·",index =12,width =15) |
| | | private String appliancecode; |
| | | |
| | | |
| | | @ApiModelProperty(value = "æ¥å·¥æ¶é¿ï¼ç§ï¼", example = "1") |
| | | @ExcelColumn(name="æ¥å·¥æ¶é¿ï¼ç§ï¼",index =12,width =15) |
| | | private Integer duration; |
| | | |
| | | |
| | | @ApiModelProperty(value = "设å¤") |
| | | @ExcelColumn(name="设å¤",index =13,width =15) |
| | | private String deviceCode; |
| | |
| | | |
| | | void exportExcel(PageWrap<QueryWorkorderRecordExtDTO> pageWrap ,HttpServletResponse response); |
| | | |
| | | |
| | | void exportExcel2(PageWrap<QueryWorkorderRecordExtDTO> pageWrap ,HttpServletResponse response); |
| | | |
| | | PageData<SalaryStatisticsListVO> salaryStatistic(PageWrap<QuerySalaryStatisticDTO> pageWrap); |
| | | |
| | | PageData<UserSalaryListVO> userSalaryPage(PageWrap<QueryUserSalaryListDTO> pageWrap); |
| | |
| | | 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(re.getQualifiedNum()+unintname); |
| | | wreev.setUnqualifiedNum(re.getUnqualifiedNum()+unintname); |
| | | wreev.setDuration(re.getDuration()); |
| | | 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()+unintname ); |
| | | } |
| | | 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); |
| | | |
| | | } |
| | | } |