jcdm-framework/src/main/java/com/jcdm/framework/config/SecurityConfig.java
@@ -119,6 +119,7 @@ .antMatchers("/jcdmMes/**").permitAll() .antMatchers("/da/testDeviceInterface/**").permitAll() .antMatchers("/main/paramCollection/**").permitAll() .antMatchers("/bs/formulaChild/**").permitAll() // 除上面外的所有请求全部需要鉴权认证 .anyRequest().authenticated() .and() jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
@@ -50,6 +50,7 @@ import java.text.SimpleDateFormat; import java.time.Instant; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; /** @@ -245,6 +246,7 @@ daParamCollectionTemp.setCollectionTime(new Date()); daParamCollectionTemp.setSfcCode(daParamCollection.getProductBarcode()); daParamCollectionTemp.setLocationCode(daParamCollection.getLocationCode()); daParamCollectionTemp.setProductCode(daParamCollection.getProductCode()); daParamCollectionTempService.save(daParamCollectionTemp); } } @@ -462,6 +464,7 @@ @Override public void pushGeelycvMesFeedback(String packID, String stationCode) { logger.info("进入人工工位推送工厂MES数据方法-pushGeelycvMesFeedback-工位{}-pack码{}",stationCode,packID); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback"; String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback"; @@ -516,12 +519,25 @@ } parentVO.setCheckList(listChildVo); HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); List<Long> idsList = paramList.stream().map(DaParamCollectionTemp::getId).collect(Collectors.toList()); Long[] array = idsList.toArray(new Long[0]); daParamCollectionTempService.deleteDaParamCollectionTempByIds(array); System.out.println(execute.body()); try{ CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { logger.info("开始执行异步方法"); HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); logger.info("异步方法执行结束"); logger.info("手动工位传工厂MES异步方法{}"+execute.body()); List<Long> idsList = paramList.stream().map(DaParamCollectionTemp::getId).collect(Collectors.toList()); Long[] array = idsList.toArray(new Long[0]); int i = daParamCollectionTempService.deleteDaParamCollectionTempByIds(array); logger.info("删除临时表数据条数{}-工位{}-pack码{}",i,stationCode,packID); }); }catch (Exception e){ System.out.println(e.getMessage()); } // HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); // System.out.println(execute.body()); System.out.println("-----------------------"+totalResult); logger.info("结束人工工位推送工厂MES数据方法-pushGeelycvMesFeedback-工位{}-pack码{}",stationCode,packID); } } @@ -584,9 +600,19 @@ parentVO.setCheckList(listChildVo); logger.info("结束工位{}-拼数据",stationCode); logger.info("进入工位{}-工厂MES推送数据方法HttpResponseSend",stationCode); HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); try{ CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { logger.info("开始执行异步方法"); HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); System.out.println(execute.body()); logger.info("异步方法执行结束"); logger.info("自动工位传工厂MES异步方法{}"+execute.body()); }); }catch (Exception e){ System.out.println(e.getMessage()); } // HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); logger.info("结束工位{}-工厂MES推送数据方法HttpResponseSend",stationCode); System.out.println(execute.body()); System.out.println("-----------------------"+totalResult); } logger.info("结束工位{}-工厂MES推送数据方法automaticWorkstationPushGeelycvMesFeedback",stationCode); @@ -636,8 +662,18 @@ parentVO.setTotalResult("1"); parentVO.setCheckList(childVOList); HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); // try{ // CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { // logger.info("开始执行异步方法"); // HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); // System.out.println(execute.body()); // logger.info("异步方法执行结束"); // logger.info("称重异步方法{}",execute.body()); // }); // }catch (Exception e){ // System.out.println(e.getMessage()); // } RestfulService.getWorkReportResultFeedback(daParamCollection.getSfcCode(),"OP500",format.format(new Date())); System.out.println(execute.body()); } } jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java
@@ -11,6 +11,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.jcdm.common.core.domain.AjaxResult; import com.jcdm.common.utils.StringUtils; import com.jcdm.framework.websocket.WebSocketUsers; import com.jcdm.main.bs.formulaChild.domain.BsFormulaChildInfo; import com.jcdm.main.bs.formulaChild.service.IBsFormulaChildInfoService; import com.jcdm.main.constant.Constants; @@ -23,20 +24,29 @@ import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo; import com.jcdm.main.om.productionOrde.service.IOmProductionOrdeInfoService; import com.jcdm.main.restful.qingYan.doman.*; import lombok.extern.slf4j.Slf4j; import org.aspectj.weaver.loadtime.Aj; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.websocket.Session; import java.lang.reflect.Field; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; @Slf4j @RestController @RequestMapping("/jcdmMes") public class ExternalInterface { Map<String, Session> map = WebSocketUsers.getUsers(); private static final Logger logger = LoggerFactory.getLogger("sys-user"); public SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @Autowired @@ -158,11 +168,22 @@ if(StringUtils.isNotBlank(parentVO.getProductNum())){ OmProductionOrdeInfo one = omProductionOrdeInfoService.getOne(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getProductNum, parentVO.getProductNum())); if(ObjectUtil.isNotNull(one)){ logger.info("解绑小车{},pack码是{}"+one.getTrolleyYard(),one.getProductNum()); one.setTrolleyYard(""); omProductionOrdeInfoService.saveOrUpdate(one); } } } // try{ // CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { // logger.info("开始执行异步方法"); // HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); // logger.info("异步方法执行结束"); // logger.info("接收清研,气密异步方法{}"+execute.body()); // }); // }catch (Exception e){ // System.out.println(e.getMessage()); // } HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); return AjaxResult.success(execute.body()); } @@ -244,6 +265,14 @@ } /** * 放行请空状态 */ @PostMapping("/sendWebSocket") public void sendWebSocket(@RequestBody BsFormulaChildInfo bsFormulaChildInfo) { WebSocketUsers.sendMessageToUserByText(map.get(bsFormulaChildInfo.getLocationCode()), bsFormulaChildInfo.getResults()); } /** * 使用反射获取对象的属性值 jcdm-ui/src/views/main/cfkb/Instructions/index.vue
@@ -31,26 +31,26 @@ <div> <div style="display: none" id="printMe"> <br> <p style="margin-left: 25px">9900166410</p> <p style="margin-left: 25px">HW001.001</p> <p style="margin-left: 25px">SW002.005</p> <p style="margin-left: 43px">9900166410</p> <p style="margin-left: 43px">HW001.001</p> <p style="margin-left: 43px">SW002.005</p> <br> <span style="font-size: 30px;font-weight: bold;margin-left: 25px;">GEELY</span><br> <span style="font-size: 10px;margin-left: 14px">COMMERCIAL VEHICLE</span><br> <span style="margin-left: 44px">H2155D</span><br> <span style="margin-left: 44px">993083</span><br> <span style="margin-left: 26px">9900166410</span><br> <span style="font-size: 10px;margin-right: 10px">{{text1}}</span> <span style="font-size: 30px;font-weight: bold;margin-left: 40px;">GEELY</span><br> <span style="font-size: 10px;margin-left: 29px">COMMERCIAL VEHICLE</span><br> <span style="margin-left: 60px">H2155D</span><br> <span style="margin-left: 63px">993083</span><br> <span style="margin-left: 40px">9900166410</span><br> <span style="font-size: 10px;margin-left: 17px;">{{text1}}</span> <br> <br> <br> <br> <div ref="canvasWrapper" id="canvasWrapper1" style="display: flex;justify-content: center;margin-top: -27px"></div> <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;">P9900166410#T{{text1}}#V993983#SSW002.005#HHW001.001#NBMS#</span> <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 9px">P9900166410#T{{text1}}#V993983#SSW002.005#HHW001.001#NBMS#</span> <br> <br> <div ref="canvasWrapper" id="canvasWrapper2" style="display: flex;justify-content: center;margin-top: -27px"></div> <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;">P9900166410#T{{text1}}#V993983#SSW002.005#HHW001.001#NBMS#</span> <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 9px">P9900166410#T{{text1}}#V993983#SSW002.005#HHW001.001#NBMS#</span> </div> <el-button @click="print1">打印</el-button> <el-button style="display: none" @click="test1">生成二维码</el-button> jcdm-ui/src/views/main/om/productionOrde/index.vue
@@ -147,16 +147,16 @@ @click="patchwork" >补打</el-button> </el-col> <el-col :span="1.5"> <el-button type="warning" plain icon="el-icon-download" size="mini" :disabled="single" @click="jieBang" >解绑</el-button> </el-col> <!-- <el-col :span="1.5">--> <!-- <el-button--> <!-- type="warning"--> <!-- plain--> <!-- icon="el-icon-download"--> <!-- size="mini"--> <!-- :disabled="single"--> <!-- @click="jieBang"--> <!-- >解绑</el-button>--> <!-- </el-col>--> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row>