Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
| | |
| | | const dialogFormVisiblea = ref(false) |
| | | const dialogFormVisibleb = ref(false) |
| | | const dialogFormVisiblec = ref(false) |
| | | const dialogFormVisibles = ref(false) |
| | | const tableData = ref([]) |
| | | const tableDatagh = ref([]) |
| | | const tableDatab = ref([]) |
| | |
| | | const tableDataf = ref([]) |
| | | const tableDatae = ref([]) |
| | | const tableDatax = ref([]) |
| | | const tableDatas = ref([]) |
| | | const carPosition = ref([]) |
| | | const ganghua = ref('') |
| | | const adjustedRects = ref([]); |
| | |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | // 指定流程卡 |
| | | const brokes = async(row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('searchOrder.specifytemperinga'), |
| | | t('searchOrder.prompt'), |
| | | { |
| | | confirmButtonText: t('searchOrder.yes'), |
| | | cancelButtonText: t('searchOrder.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/appointFlowCard",{ |
| | | flowCardId: row.flow_card_id, |
| | | layer: row.layer, |
| | | }); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | // 出片队列拿走 |
| | | const brokeb = async(row) => { |
| | | try { |
| | |
| | | } catch (error) { |
| | | // console.error('Error fetching rects :', error); |
| | | } |
| | | |
| | | |
| | | }); |
| | | const fetchFlows = async () => { |
| | | try { |
| | | const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/selectFlowCardByCache'); |
| | | if (response.code === 200) { |
| | | tableDatas.value = response.data |
| | | } else { |
| | | ElMessage.warning(response.msg) |
| | | } |
| | | } catch (error) { |
| | | // console.error('Error fetching rects :', error); |
| | | } |
| | | } |
| | | |
| | | |
| | | const fetchFlow = async () => { |
| | | try { |
| | | const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/selectTemperingGlass') |
| | |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">{{ $t('searchOrder.productionqueue') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="warning" @click="handleganghua">{{ $t('searchOrder.temperingqueries') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="info" @click="handlezhiban">{{ $t('searchOrder.dutyinformation') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="info" @click="dialogFormVisibles=true;fetchFlows()">非钢化流程卡查询</el-button> |
| | | <el-switch style="margin-top: 5px;margin-left: 10px;" v-model="ganghua" class="mb-2" :inactive-text="$t('searchOrder.temperedswitch')" @change="handleChange" /> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisibles" top="5vh" width="85%" :title="$t('searchOrder.temperingqueries')"> |
| | | <el-table ref="table" style="margin-top: 20px;height: 500px;" |
| | | :data="tableDatas" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="flow_card_id" fixed align="center" :label="$t('searchOrder.processcards')"/> |
| | | <el-table-column prop="layer" align="center" label="层" /> |
| | | <el-table-column prop="count" align="center" :label="$t('searchOrder.numberglasses')" /> |
| | | <el-table-column fixed="right" :label="$t('searchOrder.operate')" align="center" > |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="brokes(scope.row)">指定流程卡</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | </template> |
| | | <style scoped> |
| | | #dt { display:block; float:left;line-height: 20px;margin-left: 100px;} |
| | |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.xiaoymin</groupId> |
| | | <artifactId>knife4j-spring-boot-starter</artifactId> |
| | | <version>2.0.9</version> |
| | | </dependency> |
| | | <!-- 2.0~2.2 Knife4j 2.0.0 ~ 2.0.6--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.xiaoymin</groupId>--> |
| | | <!-- <artifactId>knife4j-spring-boot-starter</artifactId>--> |
| | | <!-- <version>2.0.6</version>--> |
| | | <!-- <groupId>io.springfox</groupId>--> |
| | | <!-- <artifactId>springfox-swagger2</artifactId>--> |
| | | <!-- <version>2.7.0</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger2</artifactId> |
| | | <version>2.7.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger-ui</artifactId> |
| | | <version>2.7.0</version> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>io.springfox</groupId>--> |
| | | <!-- <artifactId>springfox-swagger-ui</artifactId>--> |
| | | <!-- <version>2.7.0</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!--hutool java验证方法类--> |
| | | <dependency> |
| | |
| | | * A09出片目标位置 d02卧转立 钢化出片 3001 |
| | | * A10出片目标位置 d05卧转立 人工出片 3002 |
| | | */ |
| | | public static final Integer TEMPERING_OUT_TARGET_POSITION = 3001; |
| | | public static final Integer TEMPERING_OUT_TARGET_POSITION = 3002; |
| | | public static final Integer ARTIFICIAL_OUT_TARGET_POSITION = 3002; |
| | | |
| | | /** |
| | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import springfox.documentation.builders.ApiInfoBuilder; |
| | | import springfox.documentation.builders.ParameterBuilder; |
| | | import springfox.documentation.builders.PathSelectors; |
| | | import springfox.documentation.builders.RequestHandlerSelectors; |
| | | import springfox.documentation.schema.ModelRef; |
| | | import springfox.documentation.service.*; |
| | | import springfox.documentation.service.ApiInfo; |
| | | import springfox.documentation.service.Contact; |
| | | import springfox.documentation.spi.DocumentationType; |
| | | import springfox.documentation.spi.service.contexts.SecurityContext; |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhan_py |
| | |
| | | @Configuration |
| | | public class Swagger2Config { |
| | | |
| | | |
| | | @Bean |
| | | public Docket webApiConfig() { |
| | | List<Parameter> pars = new ArrayList<>(); |
| | | ParameterBuilder tokenPar = new ParameterBuilder(); |
| | | tokenPar.name("userId") |
| | | .description("用户token") |
| | | //.defaultValue(JwtHelper.createToken(1L, "admin")) |
| | | .defaultValue("1") |
| | | .modelRef(new ModelRef("string")) |
| | | .parameterType("header") |
| | | .required(false) |
| | | .build(); |
| | | pars.add(tokenPar.build()); |
| | | public Docket moduleDocket() { |
| | | return docket("mes接口文档", "com.mes"); |
| | | } |
| | | |
| | | |
| | | private Docket docket(String groupName, String basePackages) { |
| | | return new Docket(DocumentationType.SWAGGER_2) |
| | | .groupName("webApi") |
| | | .apiInfo(webApiInfo()) |
| | | .groupName(groupName) |
| | | .apiInfo(apiInfo()) |
| | | .select() |
| | | //只显示api路径下的页面 |
| | | .apis(RequestHandlerSelectors.basePackage("com.mes")) |
| | | .apis(RequestHandlerSelectors.basePackage(basePackages)) |
| | | .paths(PathSelectors.any()) |
| | | .build() |
| | | .globalOperationParameters(pars) |
| | | .securitySchemes(Collections.EMPTY_LIST) |
| | | .securityContexts(Arrays.asList(securityContext())); |
| | | } |
| | | |
| | | private SecurityContext securityContext() { |
| | | return SecurityContext.builder() |
| | | .securityReferences(defaultAuth()) |
| | | .forPaths(PathSelectors.any()) |
| | | .build(); |
| | | } |
| | | |
| | | private List<SecurityReference> defaultAuth() { |
| | | AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); |
| | | AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; |
| | | authorizationScopes[0] = authorizationScope; |
| | | return Arrays.asList(new SecurityReference("Authorization", authorizationScopes)); |
| | | } |
| | | |
| | | |
| | | private ApiInfo webApiInfo() { |
| | | private ApiInfo apiInfo() { |
| | | return new ApiInfoBuilder() |
| | | .title("网站-API文档") |
| | | .description("本文档描述了mes网站微服务接口定义") |
| | | .version("1.0") |
| | | .contact(new Contact("zhan_py", "", "")) |
| | | .title("mes接口文档系统") |
| | | .description("mesApi接口文档系统") |
| | | .license("Powered By mes") |
| | | .licenseUrl("http://127.0.0.1") |
| | | .termsOfServiceUrl("http://127.0.0.1") |
| | | .contact(new Contact("mes", "http://127.0.0.1", "beibo@mes.com")) |
| | | .version("V1.0.0") |
| | | .build(); |
| | | } |
| | | |
| | | |
| | | // @Bean |
| | | // public Docket webApiConfig() { |
| | | // List<Parameter> pars = new ArrayList<>(); |
| | | // ParameterBuilder tokenPar = new ParameterBuilder(); |
| | | // tokenPar.name("userId") |
| | | // .description("用户token") |
| | | // .defaultValue("1") |
| | | // .modelRef(new ModelRef("string")) |
| | | // .parameterType("header") |
| | | // .required(false) |
| | | // .build(); |
| | | // pars.add(tokenPar.build()); |
| | | // |
| | | // return new Docket(DocumentationType.SWAGGER_2) |
| | | // .apiInfo(webApiInfo()) |
| | | // .select() |
| | | // //只显示api路径下的页面 |
| | | // .apis(RequestHandlerSelectors.basePackage("com.mes")) |
| | | // .paths(PathSelectors.any()) |
| | | // .build() |
| | | // .globalOperationParameters(pars) |
| | | // .securitySchemes(Collections.EMPTY_LIST) |
| | | // .securityContexts(Arrays.asList(securityContext())); |
| | | // } |
| | | // |
| | | // private SecurityContext securityContext() { |
| | | // return SecurityContext.builder() |
| | | // .securityReferences(defaultAuth()) |
| | | // .forPaths(PathSelectors.any()) |
| | | // .build(); |
| | | // } |
| | | // |
| | | // private List<SecurityReference> defaultAuth() { |
| | | // AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); |
| | | // AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; |
| | | // authorizationScopes[0] = authorizationScope; |
| | | // return Arrays.asList(new SecurityReference("Authorization", authorizationScopes)); |
| | | // } |
| | | // |
| | | // |
| | | // private ApiInfo webApiInfo() { |
| | | // return new ApiInfoBuilder() |
| | | // .title("网站-API文档") |
| | | // .description("本文档描述了mes网站微服务接口定义") |
| | | // .version("1.0") |
| | | // .contact(new Contact("zhan_py", "", "")) |
| | | // .build(); |
| | | // } |
| | | } |
| | |
| | | List<DamagePrint> selectDamagePrint(Damage damage); |
| | | |
| | | List<DamagePrint> selectDamagePrintDetails(Damage damage); |
| | | |
| | | void deleteByGlassId(String glassId); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.entity.DamagePrint; |
| | | import com.mes.damage.mapper.DamageMapper; |
| | |
| | | } |
| | | this.saveBatch(damageList); |
| | | } |
| | | |
| | | /** |
| | | * 拿走打印数据查询 |
| | | */ |
| | |
| | | } |
| | | return damageMapper.selectJoinList(DamagePrint.class,listDamage); |
| | | } |
| | | |
| | | /** |
| | | * 拿走打印打印详情查询 |
| | | */ |
| | |
| | | ); |
| | | return listDamage; |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByGlassId(String glassId) { |
| | | baseMapper.delete( |
| | | new LambdaQueryWrapper<Damage>() |
| | | .eq(Damage::getGlassId, glassId) |
| | | .in(Damage::getType, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | ); |
| | | } |
| | | } |
| | |
| | | * 玻璃ID |
| | | */ |
| | | private String glassId; |
| | | /** |
| | | * 是否合并 |
| | | */ |
| | | private Integer merge; |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | private Integer orderSort; |
| | | /** |
| | | * 是否合并 |
| | | */ |
| | | private Integer merge; |
| | | /** |
| | | * 旋转角度 |
| | | */ |
| | | private double rotateAngle; |
| | |
| | | List<OptimizeGlassinfo> optimizeGlassinfos = null; |
| | | if (engineeringId != null) { |
| | | optimizeGlassinfos = optimizeProjectMapper.selectJoinList(OptimizeGlassinfo.class, new MPJQueryWrapper<OptimizeProject>() |
| | | .select("b.process_id,t.glass_type,b.o_width,b.o_height,t.glass_thickness,b.order_sort,b.p_width,b.p_height,b.layer, b.total_layer, b.stock_id,b.heat_layout_id,b.heat_layout_sort,c.x_axis,c.y_axis,b.project_no,b.glass_id,c.rotate_angle") |
| | | .select("b.process_id,t.glass_type,b.o_width,b.o_height,t.glass_thickness,b.order_sort,b.p_width,b.p_height,b.layer, b.total_layer, b.stock_id,b.heat_layout_id,b.heat_layout_sort,c.x_axis,c.y_axis,b.project_no,b.glass_id,c.rotate_angle,d.merge") |
| | | .leftJoin("optimize_detail b on t.project_no=b.project_no") |
| | | .leftJoin("optimize_heat_detail c on c.project_no=t.project_no and b.heat_layout_id=c.layout_id and b.heat_layout_sort=c.sort") |
| | | .leftJoin("flow_card d on d.process_id=b.process_id and d.layers_number=b.layer") |
| | | //.eq("t.state",100) |
| | | .eq("t.project_no", engineeringId)); |
| | | } |
| | | //order_sort,o_width,o_height |
| | | // 创建一个 List 用于保存映射后的实体对象 |
| | | List<GlassInfo> resultList = new ArrayList<>(); |
| | | |
| | |
| | | glassInfo.setYCoordinate(map.getYAxis()); |
| | | glassInfo.setAngle(map.getRotateAngle()); |
| | | glassInfo.setGlassId(map.getGlassId()); |
| | | glassInfo.setMerge(map.getMerge()); |
| | | // 将映射后的对象添加到结果列表中 |
| | | resultList.add(glassInfo); |
| | | } |
| | |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | @SpringBootApplication |
| | | @MapperScan("com.mes.*.mapper") |
| | | @EnableDiscoveryClient |
| | | @EnableSwagger2 |
| | | @EnableSwagger2WebMvc |
| | | @EnableScheduling |
| | | public class CacheGlassModuleApplication { |
| | | |
| | |
| | | //加笼子里面是否有玻璃,有先出,无玻璃先进 |
| | | boolean outFlase = outTo(Integer.parseInt(out08Glassstate), |
| | | Integer.parseInt(out10Glassstate), confirmationWrodAddress, glassIdeValue, Integer.parseInt(currentSlot)); |
| | | log.info("出片任务是否完成:{},失败且玻璃id:{}不为空则执行进片任务", outFlase, glassIdeValue); |
| | | log.info("出片任务是否完成:{},且玻璃id:{}不为空则执行进片任务", outFlase, glassIdeValue); |
| | | if (!outFlase && StringUtils.isNotBlank(glassIdeValue)) { |
| | | inTo(glassIdeValue, confirmationWrodAddress, currentSlot); |
| | | } |
| | |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | */ |
| | | @Slf4j |
| | | @SpringBootApplication |
| | | @EnableSwagger2 |
| | | @EnableSwagger2WebMvc |
| | | @EnableDiscoveryClient |
| | | @MapperScan(basePackages = "com.mes.*.mapper") |
| | | @EnableScheduling |
| | |
| | | package com.mes.bigstorage.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | return Result.build(200, "查询成功", flowCardIdCount); |
| | | } |
| | | |
| | | @ApiOperation("指定流程卡") |
| | | @PostMapping("/appointFlowCard") |
| | | public Result appointFlowCard(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList=bigStorageCageDetailsService.list( |
| | | new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getState,Const.GLASS_STATE_ARTIFICIAL) |
| | | ); |
| | | if(bigStorageCageDetailsList.size()==0){ |
| | | bigStorageCageDetailsService.update( |
| | | new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getState,Const.GLASS_STATE_ARTIFICIAL) |
| | | .eq(BigStorageCageDetails::getFlowCardId,bigStorageCageDetails.getFlowCardId()) |
| | | .eq(BigStorageCageDetails::getLayer,bigStorageCageDetails.getLayer()) |
| | | .eq(BigStorageCageDetails::getState,Const.GLASS_STATE_IN) |
| | | ); |
| | | return Result.build(200, "指定流程卡成功", 1); |
| | | }else{ |
| | | return Result.build(200, "指定流程卡成功", 1); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | * 工程号 |
| | | */ |
| | | @ApiModelProperty(value = "层", position = 17) |
| | | private String layer; |
| | | private int layer; |
| | | |
| | | /** |
| | | * 进片任务 |
| | |
| | | public void plcToHomeEdgFreeCarTask() { |
| | | Date startDate = new Date(); |
| | | log.info("大理片笼空车进片任务开始执行时间:{}", startDate); |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | String mesD03Address = plcMesObject.getPlcParameter("MESToD03").getValue(); |
| | | String mesD05Address = plcMesObject.getPlcParameter("MESToD05").getValue(); |
| | | log.info("MESToD03:{},MESToD05:{}",mesD03Address,mesD05Address); |
| | | if("2".equals(mesD03Address)||"2".equals(mesD05Address)){ |
| | | log.info("有启动信号,MESToD03:{},MESToD05:{}",mesD03Address,mesD05Address); |
| | | } |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String e01Status = plcParameterObject.getPlcParameter("E01State").getValue(); |
| | | String d03ToMES = plcParameterObject.getPlcParameter("D03ToMES").getValue(); |
| | |
| | | bigStorageCageFeedTask.setWidth(width); |
| | | bigStorageCageFeedTask.setHeight(height); |
| | | bigStorageCageFeedTask.setCreateTime(new Date()); |
| | | //删除理片笼表拿走/破损数据数据 |
| | | damageService.deleteByGlassId(glassId); |
| | | return bigStorageCageFeedTaskService.save(bigStorageCageFeedTask); |
| | | } |
| | | |
| | |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | */ |
| | | @Slf4j |
| | | @SpringBootApplication |
| | | @EnableSwagger2 |
| | | @EnableSwagger2WebMvc |
| | | @EnableDiscoveryClient |
| | | @MapperScan(basePackages = "com.mes.*.mapper") |
| | | @EnableScheduling |
| | |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | */ |
| | | @Slf4j |
| | | @SpringBootApplication |
| | | @EnableSwagger2 |
| | | @EnableSwagger2WebMvc |
| | | @EnableDiscoveryClient |
| | | @EnableScheduling |
| | | @MapperScan(basePackages = "com.mes.*.mapper") |
| | |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | */ |
| | | @Slf4j |
| | | @SpringBootApplication |
| | | @EnableSwagger2 |
| | | @EnableSwagger2WebMvc |
| | | @EnableDiscoveryClient |
| | | @EnableScheduling |
| | | @MapperScan(basePackages = "com.mes.*.mapper") |
| | |
| | | String startOfPeriodStr = startOfPeriod.format(formatter); |
| | | String endOfPeriodStr = endOfPeriod.format(formatter); |
| | | // 设置为最近七天的时间范围 |
| | | reportingdamage.setReportingWorkTime("2024-05-11"); |
| | | //reportingdamage.setReportingWorkTime("2024-05-11"); |
| | | reportingdamage.setReportingWorkTime(startOfPeriodStr); |
| | | reportingdamage.setReportingWorkTime2(endOfPeriodStr); |
| | | //扇形图各设备的加工破损数量 |
| | | List<Reportingdamage> device = reportingWorkService.selectDamage(reportingdamage); |
| | |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | */ |
| | | @Slf4j |
| | | @SpringBootApplication |
| | | @EnableSwagger2 |
| | | @EnableSwagger2WebMvc |
| | | @EnableDiscoveryClient |
| | | @MapperScan(basePackages = "com.mes.*.mapper") |
| | | @EnableScheduling |
| | |
| | | @ApiOperation("新增虚拟工位") |
| | | @PostMapping("/insertDownWorkstation") |
| | | public Result insertDownWorkstation() { |
| | | DownWorkstation downWorkstation = new DownWorkstation(); |
| | | downWorkstation.setTotalQuantity(0); |
| | | downWorkstation.setRacksNumber(0); |
| | | downWorkstation.setOtherNumber(0); |
| | | downWorkstation.setDeviceId(3); |
| | | downWorkstation.setEnableState(1); |
| | | downWorkstation.setWorkState(1); |
| | | downWorkstationService.save(downWorkstation); |
| | | downWorkstationService.insertDownWorkstation(); |
| | | return Result.build(200, "新增成功", 1); |
| | | } |
| | | |
| | |
| | | String closeAlarmSignal(); |
| | | |
| | | void autoPrint(Boolean flag); |
| | | |
| | | void insertDownWorkstation(); |
| | | } |
| | |
| | | .set("layer", layer) |
| | | .set("other_number", otherNumber) |
| | | .eq("workstation_id", workstationId); |
| | | // .eq("id", workstationId); |
| | | |
| | | this.update(updateWrapper); |
| | | |
| | |
| | | redisUtil.setCacheObject("autoPrint", flag); |
| | | } |
| | | |
| | | @Override |
| | | public void insertDownWorkstation() { |
| | | DownWorkstation downWorkstation = new DownWorkstation(); |
| | | downWorkstation.setWorkstationId(7); |
| | | downWorkstation.setTotalQuantity(0); |
| | | downWorkstation.setRacksNumber(0); |
| | | downWorkstation.setOtherNumber(0); |
| | | downWorkstation.setDeviceId(3); |
| | | downWorkstation.setEnableState(1); |
| | | downWorkstation.setWorkState(1); |
| | | baseMapper.insert(downWorkstation); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | List<String> glassList = downGlassTaskList.stream().map(DownGlassTask::getGlassId).collect(Collectors.toList()); |
| | | //将任务表中的数据删除 |
| | | downGlassTaskService.remove(new LambdaQueryWrapper<DownGlassTask>().in(DownGlassTask::getTaskType, Const.GLASS_CACHE_TYPE_OUT_ALL).in(DownGlassTask::getGlassId, glassList)); |
| | | //清除下片玻璃信息表数据 |
| | | downGlassInfoService.remove(new LambdaQueryWrapper<DownGlassInfo>().in(DownGlassInfo::getGlassId, glassList)); |
| | | //下片数量-1 |
| | | for (DownGlassTask downGlassTask : downGlassTaskList |
| | | ) { |
| | | if (Const.GLASS_CACHE_TYPE_OUT_ALL.equals(downGlassTask.getTaskType())) { |
| | | downWorkstationService.update( |
| | | new LambdaUpdateWrapper<DownWorkstation>() |
| | | .setSql("racks_number = racks_number-1") |
| | | .eq(DownWorkstation::getWorkstationId, downGlassTask.getEndCell()) |
| | | ); |
| | | |
| | | } |
| | | } |
| | | List<Damage> damageList = downGlassTaskList.stream().map(e -> { |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(e.getGlassId()); |
| | |
| | | log.info("有空架子,将流程卡与架子好绑定,执行进片任务 结束"); |
| | | //绑定流程卡 |
| | | downWorkstationService.updateFlowCardIdAndCount(glassInfo.getFlowCardId(), list.get(0).getWorkstationId(), glassInfo.getLayer()); |
| | | // downWorkstationService.updateFlowCardIdAndCount(glassInfo.getFlowCardId(), list.get(0).getId(), glassInfo.getLayer()); |
| | | checkFlag = Boolean.TRUE; |
| | | } |
| | | } |
| | |
| | | downStorageCageDetailsService.save(downStorageCageDetails); |
| | | // 生成进片任务 |
| | | initDownGlassTask(glassInfo, 0, nearestEmpty.getSlot(), Const.GLASS_CACHE_TYPE_IN); |
| | | //删除理片笼表拿走/破损数据数据 |
| | | damageService.deleteByGlassId(glassInfo.getGlassId()); |
| | | } |
| | | |
| | | public Boolean outTo(String glassStatus06, String out08Glassstate, String glassStatus11, String |
| | |
| | | if (null != emptyDownWorkstation) { |
| | | log.info("获取到空架子信息,绑定流程卡"); |
| | | downWorkstationService.updateFlowCardIdAndCount(downStorageCageDetails.getFlowCardId(), emptyDownWorkstation.getWorkstationId(), downStorageCageDetails.getLayer()); |
| | | // downWorkstationService.updateFlowCardIdAndCount(downStorageCageDetails.getFlowCardId(), emptyDownWorkstation.getId(), downStorageCageDetails.getLayer()); |
| | | endCell = emptyDownWorkstation.getWorkstationId(); |
| | | } else { |
| | | //todo:增加虚拟工位,绑定流程卡 |
| | | // downWorkstationService.insertDownWorkstation(); |
| | | // endCell = Const.G13_WORK_STATION; |
| | | // downWorkstationService.updateFlowCardIdAndCount(downStorageCageDetails.getFlowCardId(), emptyDownWorkstation.getId(), downStorageCageDetails.getLayer()); |
| | | log.info("没有空架子信息,无法绑定流程卡"); |
| | | return Boolean.FALSE; |
| | | } |
| | |
| | | //生成任务信息 |
| | | GlassInfo glassInfo = new GlassInfo(); |
| | | BeanUtils.copyProperties(downStorageCageDetails, glassInfo); |
| | | //删除理片笼表拿走/破损数据数据 |
| | | damageService.deleteByGlassId(glassInfo.getGlassId()); |
| | | return initDownGlassTask(glassInfo, downStorageCageDetails.getSlot(), endCell, taskType); |
| | | } |
| | | |
| | |
| | | package com.mes.job;
|
| | |
|
| | | import cn.hutool.json.JSONObject;
|
| | | import cn.smallbun.screw.core.util.CollectionUtils;
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
| | | import com.mes.common.config.Const;
|
| | |
| | | import com.mes.downstorage.service.DownStorageCageService;
|
| | | import com.mes.downworkstation.entity.DownWorkstation;
|
| | | import com.mes.downworkstation.service.DownWorkstationService;
|
| | | import com.mes.glassinfo.entity.GlassInfo;
|
| | | import com.mes.glassinfo.service.GlassInfoService;
|
| | | import com.mes.tools.DateUtil;
|
| | | import com.mes.tools.WebSocketServer;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.apache.commons.lang.StringUtils;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.beans.factory.annotation.Value;
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import java.io.BufferedReader;
|
| | | import java.io.InputStreamReader;
|
| | | import java.net.Socket;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | private DownGlassInfoService downGlassInfoService;
|
| | | @Autowired
|
| | | private DownGlassTaskService downGlassTaskService;
|
| | | @Autowired
|
| | | private GlassInfoService glassInfoService;
|
| | |
|
| | | @Value("${mes.scan.ip}")
|
| | | private String scanIp;
|
| | |
|
| | | @Value("${mes.scan.port}")
|
| | | private Integer scanPort;
|
| | |
|
| | | @Autowired
|
| | | private RedisUtil redisUtil;
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Scheduled(fixedDelay = Long.MAX_VALUE)
|
| | | public void scanCodeTask() {
|
| | | while (true) {
|
| | | try (Socket socket = new Socket(scanIp, scanPort);
|
| | | BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()))) {
|
| | | // 接收服务器响应
|
| | | String response;
|
| | | while ((response = in.readLine()) != null) {
|
| | | List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("scanCode");
|
| | | if (CollectionUtils.isNotEmpty(sendwServer)) {
|
| | | //按照玻璃id获取玻璃信息返回给前端界面,具体需要哪些数据待确认
|
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>()
|
| | | .eq(GlassInfo::getGlassId, response).last("limit 1"));
|
| | | if (null == glassInfo) {
|
| | | log.info("按照玻璃id:{},无法找到玻璃信息", response);
|
| | | } else {
|
| | | sendwServer.get(0).sendMessage(glassInfo.toString());
|
| | | }
|
| | | }
|
| | | }
|
| | | } catch (Exception exception) {
|
| | | log.info("读取异常,原因为{}", exception.getMessage());
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | throughWidth: 3000 |
| | | throughHeight: 2500 |
| | | threshold: 5 #下片的最大阈值 |
| | | scan: |
| | | ip: 127.0.0.1 |
| | | port: 5000 |
| | |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.plugin</groupId> |
| | | <artifactId>spring-plugin-core</artifactId> |
| | | <version>2.0.0.RELEASE</version> |
| | | </dependency> |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | |