| | |
| | | "last 2 versions", |
| | | "not dead" |
| | | ] |
| | | } |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | export function FinishTask(tasktype,id) { |
| | | export function FinishTask(id) { |
| | | return request({ |
| | | url: '/home/FinishTask?tasktype='+tasktype+'&id='+id, |
| | | url: '/home/FinishTask?id='+id, |
| | | method: 'post', |
| | | data:"" |
| | | }) |
| | |
| | | { |
| | | |
| | | "Operation failed":"Operation canceled", |
| | | "Flowcard":"Flowcard", |
| | | "Glasstype":"Glasstype", |
| | | "Mode Change":"Mode Change", |
| | |
| | | </label> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex;justify-content: space-around;width: 9zz5%;margin: 0 auto;"> |
| | | <el-button type="primary" @click="showform(1)" :disabled="SoftEmergencyStopState" |
| | | :class="SoftEmergencyStopState == true ? 'hide' : ''"> |
| | | <div style="display:flex;justify-content: space-around;width: 95%;margin: 0 auto;"> |
| | | <el-button type="primary" @click="showform(1)" :disabled="SoftEmergencyStopState" style="z-index: 999;" |
| | | > |
| | | {{ $t('Import order') }}</el-button> |
| | | <el-button type="primary" @click="showform(2)" :disabled="SoftEmergencyStopState" |
| | | :class="SoftEmergencyStopState == true ? 'hide' : ''"> |
| | | |
| | | <el-button type="primary" @click="showform(2)" :disabled="SoftEmergencyStopState" style="z-index: 999;" |
| | | > |
| | | {{ $t('Measure') }}</el-button> |
| | | <el-button type="primary" @click="showform(3)" :disabled="SoftEmergencyStopState" |
| | | :class="SoftEmergencyStopState == true ? 'hide' : ''"> |
| | | |
| | | <el-button type="primary" @click="showform(3)" :disabled="SoftEmergencyStopState" style="z-index: 999;" |
| | | > |
| | | {{ $t('StorageCage') }}</el-button> |
| | | <el-button type="primary" @click="showform(4)" :disabled="SoftEmergencyStopState" |
| | | :class="SoftEmergencyStopState == true ? 'hide' : ''"> |
| | | <el-button type="primary" @click="showform(4)" :disabled="SoftEmergencyStopState" style="z-index: 999;" |
| | | > |
| | | {{ $t('Task queue') }}</el-button> |
| | | |
| | | </div> |
| | | <div style="display: flex;align-items: center;"> |
| | | <div class="blocks" style="position: relative;width: 100%;"> |
| | |
| | | <el-dialog :visible.sync="Importorder" :title="$t('Import order')" top="5vh"> |
| | | </el-dialog> |
| | | |
| | | <el-dialog :visible.sync="Measure" :title="$t('Measure')" top="5vh"> |
| | | <el-dialog :visible.sync="Measure" :title="$t('Measure')" top="5vh"><!--测量页面--> |
| | | <!--测量页面主体--> |
| | | <div> |
| | | <!--功能--> |
| | | <div> |
| | | <el-button type="primary" @click="ManualMatching()" :disabled="SoftEmergencyStopState" style="z-index: 999;"> |
| | | 人工匹配</el-button> |
| | | |
| | | </div> |
| | | <!--显示--> |
| | | <div style="width:100%;height: 600px;border: 1px solid black;"> |
| | | <!--玻璃图--> |
| | | <div |
| | | style="top:0;bottom: 0;left: 0;right: 0;margin: auto;position:absolute;width: 100px;height: 200px;background-color: aqua;line-height: 200px;text-align: center;"> |
| | | 100*200 |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <el-dialog :visible.sync="StorageCage" :title="$t('StorageCage')" top="5vh"> |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="state" :label="$t('Task State')"> |
| | | <template slot-scope='scope'> |
| | | {{ scope.state == 0 ? $t('Start') : $t('Finished') }} |
| | | {{ scope.row.state >= 0?scope.row.state == 0 ? $t('Start') : $t('Stop'):"" }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="method" :label="$t('Task Method')"> |
| | |
| | | name: "Home", |
| | | data() { |
| | | return { |
| | | tableData1:[], |
| | | tableData1: [], |
| | | Measuermode: false, |
| | | confirm1: false, |
| | | confirm2: false, |
| | |
| | | this.cagelist4 = obj.cagelist4[0]; |
| | | this.tasklist2 = obj.StoragTaskeTaskFeed[0]; |
| | | this.tasklist1 = obj.StoragTaskeTaskOut[0]; |
| | | console.log(this.tasklist1); |
| | | this.alarm = obj.alarmmg[0]; |
| | | |
| | | this.tableData1 = obj.OrderTask[0]; |
| | |
| | | StorageCageAddGlass(index) { |
| | | if (this.Measuermode == true) { |
| | | StorageCageAddGlass(this.cell, this.StorageCageAddInfo[index]).then(res => { |
| | | if (res.data.code == 200) { |
| | | if (res.data.message == 200) { |
| | | this.$message.success(this.$t('Operation successful')); |
| | | } |
| | | }) |
| | | } else { |
| | | UpdateQueue(this.StorageCageAddInfo[index]).then(res => { |
| | | if (res.data.code == 200) { |
| | | if (res.data.message == 200) { |
| | | this.$message.success(this.$t('Operation successful')); |
| | | }else{ |
| | | this.$message.error(this.$t('Operation failed')); |
| | | } |
| | | }); |
| | | } |
| | |
| | | }, |
| | | //领取/暂停任务 |
| | | ClaimTasks(flowcard, state) { |
| | | console.log(flowcard, state); |
| | | ClaimTasks(flowcard, state).then(res => { |
| | | if (res.data.code == 200) { |
| | | if (res.data.message == 200) { |
| | | this.$message.success(this.$t('Operation successful')); |
| | | } |
| | | }); |
| | |
| | | //修改出片方式 |
| | | ModeChange(flowcard, method) { |
| | | ModeChange(flowcard, method).then(res => { |
| | | if (res.data.code == 200) { |
| | | if (res.data.message == 200) { |
| | | this.$message.success(this.$t('Operation successful')); |
| | | } |
| | | }); |
| | |
| | | const specialChars = /[^\w\s]/g; |
| | | return this.GlassIdList[num].replace(specialChars, ""); |
| | | } |
| | | }, |
| | | //人工匹配 |
| | | ManualMatching() { |
| | | this.StorageCageAdd=true; |
| | | } |
| | | |
| | | } |
| | |
| | | <version>5.13.1</version> |
| | | </dependency> |
| | | |
| | | <!-- <dependency> |
| | | <groupId>net.sourceforge.jexcelapi</groupId> |
| | | <artifactId>jxl</artifactId> |
| | | <version>2.6.12</version> |
| | | </dependency> --> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi</artifactId> |
| | | <version>4.1.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | <version>4.1.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml-schemas</artifactId> |
| | | <version>4.1.2</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-amqp</artifactId> |
| | |
| | | <artifactId>jackson-annotations</artifactId> |
| | | <version>2.13.0</version> |
| | | </dependency> |
| | | |
| | | |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import com.example.springboot.service.*; |
| | | |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import com.example.springboot.entity.FlowCard; |
| | |
| | | //读取DB105区文件 |
| | | PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; |
| | | |
| | | //String PlcRequest=plcmes.getPlcParameter("GaToMES").getValue();//出片请求一线 |
| | | //double width=plcmes.getPlcParameter("Height").getValue();//出片请求一线 |
| | | //double height=plcmes.getPlcParameter("width").getValue();//出片请求一线 |
| | | // 获取测量的长,宽 |
| | | //String PlcRequest=plcmes.getPlcParameter("GaToMES").getValue();//请求 |
| | | //double width=plcmes.getPlcParameter("Height").getValue();//宽 |
| | | //double height=plcmes.getPlcParameter("width").getValue();//高 |
| | | //获取测量的长,宽 |
| | | String url="C:\\Users\\SNG-ZDH-012\\Desktop\\阿尔巴尼亚数据要求.xlsx"; |
| | | //List typecount= HomeService.ReadExecl2(s); |
| | | // List xiaopian=HomeService.ReadExecl2(s); |
| | | // //xiaopian NG1{A:10,B20} NG2{A:5,B5} |
| | | // for(Object C:xiaopian){ |
| | | // //看层数 |
| | | // } |
| | | |
| | | // for(int i=0;i<result.size();i++){ |
| | | // System.out.println(result.get(i)); |
| | | // } |
| | | |
| | | |
| | | //List result= HomeService.ReadExecl(url); |
| | | // for(int i=0;i<result.size();i++){ |
| | | // System.out.println(result.get(i)); |
| | | // } |
| | | |
| | | |
| | | |
| | | String PlcRequest = "1"; |
| | | double width = 402; |
| | | double height = 402; |
| | | |
| | | //获取匹配设置 |
| | | //匹配 |
| | | if ("1".equals(PlcRequest)) { |
| | | List<GlassInfo> Result=HomeService.NormalGlassInfo(width, height, "1"); |
| | | if(Result.size()==1){ |
| | | //匹配成功 就一种类型 添加数据 |
| | | GlassInfo GlassInfo=Result.get(0); |
| | | QueueMapper.insert(GlassInfo.getGlassid(),width,height,1); |
| | | System.out.println("匹配成功"); |
| | | //S7control.getinstance().WriteWord(plcmes.getPlcParameter("GaToMES").getAddress(), (short) 1); |
| | | System.out.println(GlassInfo.getGlassid()); |
| | | }else if(Result.size()>1){ |
| | | //匹配失败 匹配到多条符合的数据 添加数据 |
| | | QueueMapper.insert(null,width,height,2); |
| | | System.out.println("匹配失败"); |
| | | } |
| | | else{ |
| | | //匹配失败 未找到符合的数据 添加数据 |
| | | QueueMapper.insert(null,width,height,3); |
| | | System.out.println("未找到符合的数据"); |
| | | } |
| | | |
| | | boolean Result=HomeService.Normal(width, height, "1"); |
| | | } |
| | | // String E01id = new String( S7controlLK.getinstance().ReadByte("DB17.0",16)); |
| | | // String J01id = new String( S7controlLK.getinstance().ReadByte("DB17.22",14)); |
| | |
| | | |
| | | //手动完成任务 |
| | | @PostMapping("/FinishTask") |
| | | public Result FinishTask(Integer tasktype,Integer id) { |
| | | return storageCageService.FinishTask(tasktype,id); |
| | | public Result FinishTask(Integer id) { |
| | | return storageCageService.FinishTask(id); |
| | | } |
| | | |
| | | //查询玻璃信息 |
| | |
| | | private Double thickness;// 厚 |
| | | private Integer number;// 数量 |
| | | private Integer finishnumber;// 完成数量 |
| | | private Integer measurenumber;// 测量完成数量 |
| | | } |
| | |
| | | private String loadrack;//目标位 |
| | | private Integer count;//玻璃数量 |
| | | private Integer glasstype;//玻璃类型 |
| | | private Integer flowcard;//流程卡 |
| | | private String flowcard;//流程卡 |
| | | private Integer mateid;//配片id |
| | | private Integer tier;//片序 |
| | | |
| | |
| | | public void setGlasstype(Integer glasstype) { |
| | | this.glasstype = glasstype; |
| | | } |
| | | public Integer getFlowcard() { |
| | | public String getFlowcard() { |
| | | return flowcard; |
| | | } |
| | | |
| | | public void setFlowcard(Integer flowcard) { |
| | | public void setFlowcard(String flowcard) { |
| | | this.flowcard = flowcard; |
| | | } public Integer getMateid() { |
| | | return mateid; |
| | |
| | | private Double thickness;// 厚 |
| | | private Integer number;// 数量 |
| | | private Integer finishnumber;// 完成数量 |
| | | private Integer measurenumber;// 测量完成数量 |
| | | } |
New file |
| | |
| | | package com.example.springboot.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.springboot.entity.GlassInfo; |
| | | import com.example.springboot.entity.RolePermission; |
| | | |
| | | |
| | | import org.apache.ibatis.annotations.*; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface GlassInfoMapper extends BaseMapper<GlassInfo> { |
| | | |
| | | @Select("SELECT * FROM glassinfo where width<=#{maxwidth} and width>=#{minwidth} and height<=#{maxheight} and height>=#{minheight} and measurenumber<number") |
| | | List<GlassInfo> selectGlassInfos(@Param("maxwidth") double maxwidth, @Param("minwidth") double minwidth, @Param("maxheight") double maxheight, @Param("minheight") double minheight); |
| | | |
| | | // @Select("SELECT COUNT(*) FROM role_permission WHERE role_id = #{roleId} AND permission_id = #{permissionId}") |
| | | // boolean checkExists(@Param("roleId") int roleId, @Param("permissionId") int permissionId); |
| | | |
| | | |
| | | @Update("UPDATE glassinfo SET measurenumber = measurenumber+1 WHERE id = #{id}") |
| | | void updatemeasurenumber(@Param("id") int roleId); |
| | | |
| | | // @Insert("INSERT INTO role_permission (role_id, permission_id, state) VALUES (#{roleId}, #{permissionId}, #{state})") |
| | | // void insert(@Param("roleId") int roleId, @Param("permissionId") int permissionId, @Param("state") int state); |
| | | |
| | | } |
| | |
| | | @Update("update flowcard set method=#{method} where flowcard=#{flowcard}") |
| | | void ModeChange(String flowcard, int method); |
| | | |
| | | @Update("update queue set flowcard=#{flowcard},glasswidth=#{width},glassheight=#{height},glasstype=#{glasstype} where state=0") |
| | | @Update("update queue set flowcard=#{flowcard},glasswidth=#{width},glassheight=#{height},glasstype=#{glasstype},state=1 where state=0") |
| | | void UpdateQueue(String flowcard,double width,double height,Integer glasstype); |
| | | |
| | | @Update("update glassinfo set finishnumber=finishnumber+1 where flowcard=#{flowcard} and mateid=#{mateid} and tier=#{geTier}") |
| | | void AddGlassNo(Integer flowcard, Integer mateid, Integer geTier); |
| | | void AddGlassNo(String flowcard, Integer mateid, Integer geTier); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.example.springboot.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.springboot.entity.GlassInfo; |
| | | import com.example.springboot.entity.MeasureSetting; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface MeasureSettingMapper extends BaseMapper<MeasureSetting> { |
| | | @Select("SELECT * FROM measuresetting where line=#{line}") |
| | | MeasureSetting SelectMeasureSetting(@Param("line") String line); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.example.springboot.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.springboot.entity.Queue; |
| | | import com.example.springboot.entity.RolePermission; |
| | | |
| | | |
| | | import org.apache.ibatis.annotations.*; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface QueueMapper extends BaseMapper<Queue> { |
| | | @Select("SELECT * FROM queue where glassid=#{glassid}") |
| | | List<Queue> selectQueues(@Param("glassid") int glassid); |
| | | |
| | | // @Select("SELECT COUNT(*) FROM role_permission WHERE role_id = #{roleId} AND permission_id = #{permissionId}") |
| | | // boolean checkExists(@Param("roleId") int roleId, @Param("permissionId") int permissionId); |
| | | |
| | | |
| | | // @Update("UPDATE role_permission SET state = #{state} WHERE role_id = #{roleId} AND permission_id = #{permissionId}") |
| | | // void updateState(@Param("roleId") int roleId, @Param("permissionId") int permissionId, @Param("state") int state); |
| | | |
| | | @Insert("insert into queue (glassid,flowcard,listid,boxid,glasswidth,glassheight,glasswidthmm,glassheightmm,glasstype,state,time) "+ |
| | | "select glassid,flowcard,null,null,width,height,#{glasswidthmm},#{glassheightmm},glasstype,#{state},NOW() from glassinfo where glassid=#{glassid}") |
| | | void insert(@Param("glassid") String glassid, @Param("glasswidthmm") double glasswidthmm, @Param("glassheightmm") double glassheightmm,@Param("state") int state); |
| | | |
| | | @Insert("insert into queue (glassid,flowcard,listid,boxid,glasswidth,glassheight,glasswidthmm,glassheightmm,glasstype,state,time) "+ |
| | | "values (null,null,null,null,null,null,#{glasswidthmm},#{glassheightmm},null,null,NOW())") |
| | | void insertMatchFailure(@Param("glasswidthmm") double glasswidthmm, @Param("glassheightmm") double glassheightmm); |
| | | |
| | | } |
| | |
| | | package com.example.springboot.service; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.CellType; |
| | | import org.apache.poi.ss.usermodel.CellValue; |
| | | import org.apache.poi.ss.usermodel.FormulaEvaluator; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.ss.usermodel.WorkbookFactory; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.example.springboot.entity.GlassInfo; |
| | | import com.example.springboot.entity.MeasureSetting; |
| | | // import com.example.springboot.mapper.GlassInfoMapper; |
| | | // import com.example.springboot.mapper.MeasureSettingMapper; |
| | | // import com.example.springboot.mapper.QueueMapper; |
| | | import com.example.springboot.mapper.GlassInfoMapper; |
| | | import com.example.springboot.mapper.MeasureSettingMapper; |
| | | import com.example.springboot.mapper.QueueMapper; |
| | | |
| | | @Service |
| | | public class HomeService { |
| | | |
| | | // @Autowired |
| | | // MeasureSettingMapper MeasureSettingMapper; |
| | | // @Autowired |
| | | // GlassInfoMapper GlassInfoMapper; |
| | | // @Autowired |
| | | // QueueMapper QueueMapper; |
| | | @Autowired |
| | | MeasureSettingMapper MeasureSettingMapper; |
| | | @Autowired |
| | | GlassInfoMapper GlassInfoMapper; |
| | | @Autowired |
| | | QueueMapper QueueMapper; |
| | | |
| | | // // 匹配玻璃 宽,高,线路 |
| | | // public List<GlassInfo> NormalGlassInfo(double width, double height, String line) { |
| | | // // |
| | | // List<GlassInfo> Results=new ArrayList<GlassInfo>(); |
| | | // // 获取匹配设置 |
| | | // MeasureSetting MeasureSetting = MeasureSettingMapper.SelectMeasureSetting(line); |
| | | // if (height > 0 && width > 0 && MeasureSetting != null) { |
| | | // // 有效参数 请求=1 长/宽>0 |
| | | // double maxheight = height + MeasureSetting.getErrorHeight(); |
| | | // double minheight = height - MeasureSetting.getErrorHeight(); |
| | | // double maxwidth = width + MeasureSetting.getErrorWidth(); |
| | | // double minwidth = width - MeasureSetting.getErrorWidth(); |
| | | // // 查询当前测量数据 |
| | | // List<GlassInfo> GlassInfos = GlassInfoMapper.selectGlassInfos(maxwidth, minwidth, maxheight, minheight); |
| | | // List types = new ArrayList<>(); |
| | | // for (int i = 0; i < GlassInfos.size(); i++) { |
| | | // Integer glasstype = GlassInfos.get(i).getGlasstype(); |
| | | // if (!types.contains(glasstype)) { |
| | | // types.add(glasstype); |
| | | // Results.add(GlassInfos.get(i)); |
| | | // } |
| | | // } |
| | | // } |
| | | // return Results; |
| | | // } |
| | | // 匹配玻璃 宽,高,线路 |
| | | public List<GlassInfo> NormalGlassInfo(double width, double height, String line) { |
| | | // |
| | | List<GlassInfo> Results = new ArrayList<GlassInfo>(); |
| | | // 获取匹配设置 |
| | | MeasureSetting MeasureSetting = MeasureSettingMapper.SelectMeasureSetting(line); |
| | | if (height > 0 && width > 0 && MeasureSetting != null) { |
| | | // 有效参数 请求=1 长/宽>0 |
| | | double maxheight = height + MeasureSetting.getErrorHeight(); |
| | | double minheight = height - MeasureSetting.getErrorHeight(); |
| | | double maxwidth = width + MeasureSetting.getErrorWidth(); |
| | | double minwidth = width - MeasureSetting.getErrorWidth(); |
| | | // 查询当前测量数据 |
| | | List<GlassInfo> GlassInfos = GlassInfoMapper.selectGlassInfos(maxwidth, minwidth, maxheight, minheight); |
| | | List types = new ArrayList<>(); |
| | | for (int i = 0; i < GlassInfos.size(); i++) { |
| | | Integer glasstype = GlassInfos.get(i).getGlasstype(); |
| | | if (!types.contains(glasstype)) { |
| | | types.add(glasstype); |
| | | Results.add(GlassInfos.get(i)); |
| | | } |
| | | } |
| | | } |
| | | return Results; |
| | | } |
| | | |
| | | // 匹配逻辑 |
| | | public boolean Normal(double width, double height, String line) { |
| | | List<GlassInfo> Result = NormalGlassInfo(width, height, "1"); |
| | | if (Result.size() == 1) { |
| | | // 匹配成功 就一种类型 添加数据 |
| | | GlassInfo GlassInfo = Result.get(0); |
| | | QueueMapper.insert(GlassInfo.getGlassid(), width, height, 1); |
| | | GlassInfoMapper.updatemeasurenumber(GlassInfo.getId()); |
| | | System.out.println("匹配成功"); |
| | | |
| | | // S7control.getinstance().WriteWord(plcmes.getPlcParameter("GaToMES").getAddress(), |
| | | // (short) 1); |
| | | System.out.println(GlassInfo.getGlassid()); |
| | | return true; |
| | | } else if (Result.size() > 1) { |
| | | // 匹配失败 匹配到多条符合的数据 添加数据 |
| | | QueueMapper.insert(null, width, height, 2); |
| | | System.out.println("匹配失败"); |
| | | return false; |
| | | } else { |
| | | // 匹配失败 未找到符合的数据 添加数据 |
| | | QueueMapper.insert(null, width, height, 3); |
| | | //System.out.println("未找到符合的数据"); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | // Execl表格 传入文件路径 |
| | | public List ReadExecl(String filename) { |
| | | try { |
| | | // 创建文件对象 |
| | | File file = new File(filename); |
| | | // 创建文件输入流对象 |
| | | FileInputStream inputStream = new FileInputStream(file); |
| | | // 创建工作簿对象 |
| | | Workbook workbook = WorkbookFactory.create(inputStream); |
| | | // 获取第一个工作表对象 |
| | | Sheet sheet = workbook.getSheetAt(0); |
| | | // 创建一个实体类集合,用于存储Excel数据 |
| | | |
| | | List Results = new ArrayList(); |
| | | int i = 0; |
| | | // 遍历行 |
| | | for (Row row : sheet) { |
| | | // 遍历单元格 |
| | | List ResultRow = new ArrayList(); |
| | | // System.out.println(); |
| | | for (Cell cell : row) { |
| | | String LastCellvalue = ""; |
| | | // 判断单元格类型是否为公式类型 |
| | | if (cell.getCellType() == CellType.FORMULA) { |
| | | // 使用公式计算器计算单元格的值 |
| | | FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); |
| | | CellValue cellValue = evaluator.evaluate(cell); |
| | | // 计算后的单元格值 |
| | | LastCellvalue = cellValue.getNumberValue() + ""; |
| | | } else if (cell.getCellType() == CellType.NUMERIC) { |
| | | double value = cell.getNumericCellValue(); |
| | | if (value % 1 == 0) { |
| | | LastCellvalue = Math.round(value) + ""; |
| | | } else { |
| | | LastCellvalue = value + ""; |
| | | } |
| | | } else { |
| | | // 单元格值 |
| | | LastCellvalue = cell.toString(); |
| | | } |
| | | ResultRow.add(LastCellvalue); |
| | | // System.out.print(LastCellvalue+" "); |
| | | } |
| | | Results.add(ResultRow); |
| | | i++; |
| | | } |
| | | System.out.println(i); |
| | | // 关闭工作簿和输入流对象 |
| | | workbook.close(); |
| | | inputStream.close(); |
| | | return Results; |
| | | } catch (Exception e) { |
| | | // TODO: handle exception |
| | | System.out.println("异常"); |
| | | return new ArrayList(); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | //手动完成任务 |
| | | public Result FinishTask( Integer id) { |
| | | public Result FinishTask(Integer id) { |
| | | StorageTask storageTask = homeMapper.SelectStorageTaskById(id);//获取任务信息 |
| | | homeMapper.FinishTask(storageTask.getId());//完成任务 |
| | | if(storageTask.getTaskType().equals("0")){ |