| | |
| | | default: |
| | | endpoint: opc.tcp://127.0.0.1:49320 |
| | | security-policy: none |
| | | #websocketUrl: 'ws://10.10.12.100:8081/websocket/' |
| | | websocketUrl: 'ws://127.0.0.1:8081/websocket/' |
| | | websocketUrl: 'ws://10.10.12.100:8081/websocket/' |
| | | #websocketUrl: 'ws://127.0.0.1:8081/websocket/' |
| | | |
| | | # mybatis-plus |
| | | #mybatis-plus: |
| | |
| | | package com.jcdm.main.da.opcuaconfig.controller; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig; |
| | | import com.jcdm.main.da.opcuaconfig.domain.NodeEntity; |
| | | import com.jcdm.main.da.opcuaconfig.service.IDaOpcuaConfigService; |
| | | import com.jcdm.main.da.paramCollection.domain.DaParamCollection; |
| | | import com.jcdm.main.da.paramCollection.mapper.DaParamCollectionMapper; |
| | | import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService; |
| | | import com.jcdm.main.da.tileMatchMiddleware.domain.DaTileMatchMiddleware; |
| | | import com.jcdm.main.da.tileMatchMiddleware.service.IDaTileMatchMiddlewareService; |
| | | import com.jcdm.main.da.tileMatchRules.domain.DaTileMatchRules; |
| | | import com.jcdm.main.da.tileMatchRules.service.IDaTileMatchRulesService; |
| | | import com.jcdm.main.plcserver.sub.OPCUaSubscription; |
| | | import com.kangaroohy.milo.model.ReadWriteEntity; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | { |
| | | @Autowired |
| | | private IDaOpcuaConfigService daOpcuaConfigService; |
| | | @Autowired |
| | | private IDaParamCollectionService daParamCollectionService; |
| | | @Autowired |
| | | private IDaTileMatchRulesService daTileMatchRulesService; |
| | | @Autowired |
| | | private IDaTileMatchMiddlewareService daTileMatchMiddlewareService; |
| | | |
| | | /** |
| | | * æ¥è¯¢äº¤äºä¿¡å·é
ç½®å表 |
| | |
| | | * é
ç¦æ«ç |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:opcuaconfig:query')") |
| | | @GetMapping(value = "/barcode/{barcode}/{locationCode}") |
| | | public AjaxResult setBarcode(@PathVariable("barcode") String barcode,@PathVariable("locationCode") String locationCode) { |
| | | Boolean out= true; |
| | | @GetMapping(value = "/barcode1") |
| | | public DaParamCollection setBarcode1(String barcode,String locationCode) { |
| | | Boolean out = true; |
| | | DaParamCollection xParamCollection = null; |
| | | try { |
| | | Object SNCodeObject = miloService.readFromOpcUa("CFL4HX."+locationCode+".Code1").getValue(); |
| | | if (null == SNCodeObject){ |
| | | SNCodeObject = miloService.readFromOpcUa("CFL4HX."+locationCode+ ".Code").getValue(); |
| | | Object SNCodeObject = miloService.readFromOpcUa("CFL4HX." + locationCode + ".Code1").getValue(); |
| | | if (null == SNCodeObject) { |
| | | SNCodeObject = miloService.readFromOpcUa("CFL4HX." + locationCode + ".Code").getValue(); |
| | | } |
| | | if (null != SNCodeObject){ |
| | | if (null != SNCodeObject) { |
| | | String SNCode = SNCodeObject.toString(); |
| | | //æå
¥æ°æ® |
| | | DaParamCollection saveData = new DaParamCollection(); |
| | |
| | | saveData.setParamValue(barcode); |
| | | saveData.setLocationCode(locationCode); |
| | | saveData.setParamCode("CZM"); |
| | | saveData.setParamName("æ²è½´ç "); |
| | | saveData.setParamName("æ²è½´"); |
| | | daParamCollectionService.insertDaParamCollection(saveData); |
| | | |
| | | DaTileMatchRules TileMatchRules = new DaTileMatchRules(); |
| | | TileMatchRules.setProductSeries("380Y"); |
| | | TileMatchRules.setScanObject1("è¿æ"); |
| | | TileMatchRules.setScanObject2("æ²è½´"); |
| | | daTileMatchRulesService.selectDaTileMatchRulesList(TileMatchRules); |
| | | |
| | | for (int i = 1; i <= 3; i++) { |
| | | DaTileMatchMiddleware TileMatchMiddleware = new DaTileMatchMiddleware(); |
| | | TileMatchMiddleware.setSfcCode(SNCode); |
| | | TileMatchMiddleware.setCrankshaftNo(barcode); |
| | | TileMatchMiddleware.setCylinder((long) i); |
| | | TileMatchMiddleware.setState(1L); |
| | | daTileMatchMiddlewareService.insertDaTileMatchMiddleware(TileMatchMiddleware); |
| | | } |
| | | |
| | | DaParamCollection ParamCollection = new DaParamCollection(); |
| | | ParamCollection.setSfcCode(SNCode); |
| | | ParamCollection.setParamName("ç®±ä½"); |
| | | List<DaParamCollection> DaParamCollectionlist = daParamCollectionService.selectDaParamCollectionList(ParamCollection); |
| | | List<DaParamCollection> XTParamCollection = DaParamCollectionlist.stream().filter(x -> "ç®±ä½".equals(x.getParamName())).collect(Collectors.toList()); |
| | | if (CollUtil.isNotEmpty(XTParamCollection)) { |
| | | xParamCollection = XTParamCollection.get(0); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return toAjax(out); |
| | | return xParamCollection; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.tileMatchMiddleware.controller; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.jcdm.main.da.paramCollection.domain.DaParamCollection; |
| | | import com.jcdm.main.da.tileMatchRules.domain.DaTileMatchRules; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.jcdm.common.annotation.Log; |
| | | import com.jcdm.common.core.controller.BaseController; |
| | | import com.jcdm.common.core.domain.AjaxResult; |
| | | import com.jcdm.common.enums.BusinessType; |
| | | import com.jcdm.main.da.tileMatchMiddleware.domain.DaTileMatchMiddleware; |
| | | import com.jcdm.main.da.tileMatchMiddleware.service.IDaTileMatchMiddlewareService; |
| | | import com.jcdm.common.utils.poi.ExcelUtil; |
| | | import com.jcdm.common.core.page.TableDataInfo; |
| | | |
| | | import static com.jcdm.main.plcserver.sub.OPCUaSubscription.miloService; |
| | | |
| | | /** |
| | | * æ´»å¡è¿æé
ç¦ä¸é´Controller |
| | | * |
| | | * @author yyt |
| | | * @date 2024-05-28 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/da/tileMatchMiddleware") |
| | | public class DaTileMatchMiddlewareController extends BaseController |
| | | { |
| | | @Autowired |
| | | private IDaTileMatchMiddlewareService daTileMatchMiddlewareService; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ´»å¡è¿æé
ç¦ä¸é´å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:tileMatchMiddleware:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(DaTileMatchMiddleware daTileMatchMiddleware) |
| | | { |
| | | startPage(); |
| | | List<DaTileMatchMiddleware> list = daTileMatchMiddlewareService.selectDaTileMatchMiddlewareList(daTileMatchMiddleware); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导åºæ´»å¡è¿æé
ç¦ä¸é´å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:tileMatchMiddleware:export')") |
| | | @Log(title = "æ´»å¡è¿æé
ç¦ä¸é´", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, DaTileMatchMiddleware daTileMatchMiddleware) |
| | | { |
| | | List<DaTileMatchMiddleware> list = daTileMatchMiddlewareService.selectDaTileMatchMiddlewareList(daTileMatchMiddleware); |
| | | ExcelUtil<DaTileMatchMiddleware> util = new ExcelUtil<DaTileMatchMiddleware>(DaTileMatchMiddleware.class); |
| | | util.exportExcel(response, list, "æ´»å¡è¿æé
ç¦ä¸é´æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * è·åæ´»å¡è¿æé
ç¦ä¸é´è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:tileMatchMiddleware:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | return success(daTileMatchMiddlewareService.selectDaTileMatchMiddlewareById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æ´»å¡è¿æé
ç¦ä¸é´ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:tileMatchMiddleware:add')") |
| | | @Log(title = "æ´»å¡è¿æé
ç¦ä¸é´", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody DaTileMatchMiddleware daTileMatchMiddleware) |
| | | { |
| | | return toAjax(daTileMatchMiddlewareService.insertDaTileMatchMiddleware(daTileMatchMiddleware)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æ´»å¡è¿æé
ç¦ä¸é´ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:tileMatchMiddleware:edit')") |
| | | @Log(title = "æ´»å¡è¿æé
ç¦ä¸é´", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody DaTileMatchMiddleware daTileMatchMiddleware) |
| | | { |
| | | return toAjax(daTileMatchMiddlewareService.updateDaTileMatchMiddleware(daTileMatchMiddleware)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤æ´»å¡è¿æé
ç¦ä¸é´ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:tileMatchMiddleware:remove')") |
| | | @Log(title = "æ´»å¡è¿æé
ç¦ä¸é´", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(daTileMatchMiddlewareService.deleteDaTileMatchMiddlewareByIds(ids)); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('da:tileMatchMiddleware:query')") |
| | | @GetMapping(value = "/barcodeup") |
| | | public DaTileMatchMiddleware setBarcodeup(String barcode,String locationCode) { |
| | | DaTileMatchMiddleware rMiddleware=null; |
| | | try { |
| | | //Object SNCodeObject = miloService.readFromOpcUa("CFL4HX."+locationCode+".Code1").getValue(); |
| | | Object SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP050.Code1").getValue(); |
| | | if (null == SNCodeObject){ |
| | | //SNCodeObject = miloService.readFromOpcUa("CFL4HX."+locationCode+ ".Code").getValue(); |
| | | SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP050.Code").getValue(); |
| | | } |
| | | if (null != SNCodeObject){ |
| | | String SNCode = SNCodeObject.toString(); |
| | | |
| | | DaTileMatchMiddleware TileMatchMiddleware=new DaTileMatchMiddleware(); |
| | | TileMatchMiddleware.setSfcCode(SNCode); |
| | | TileMatchMiddleware.setPalletNo(barcode); |
| | | TileMatchMiddleware.setState(2L); |
| | | List<DaTileMatchMiddleware> TileMatchMiddlewareList=daTileMatchMiddlewareService.selectDaTileMatchMiddlewareList(TileMatchMiddleware); |
| | | if(TileMatchMiddlewareList.size()>0){ |
| | | for(int i=0;i<TileMatchMiddlewareList.size();i++){ |
| | | DaTileMatchMiddleware Middleware=TileMatchMiddlewareList.get(i); |
| | | Middleware.setState(3L); |
| | | daTileMatchMiddlewareService.updateDaTileMatchMiddleware(Middleware); |
| | | } |
| | | rMiddleware=TileMatchMiddlewareList.get(0); |
| | | } |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return rMiddleware; |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('da:tileMatchMiddleware:query')") |
| | | @GetMapping(value = "/barcode") |
| | | public DaTileMatchMiddleware setBarcode(String barcode,String locationCode) { |
| | | DaTileMatchMiddleware rMiddleware=new DaTileMatchMiddleware();; |
| | | rMiddleware.setState(1L); |
| | | List<DaTileMatchMiddleware> TileMatchMiddlewareList=daTileMatchMiddlewareService.selectDaTileMatchMiddlewareList(rMiddleware); |
| | | if(TileMatchMiddlewareList.size()>0){ |
| | | rMiddleware=TileMatchMiddlewareList.get(0); |
| | | rMiddleware.setPalletNo(locationCode); |
| | | rMiddleware.setConnectingrodNo(barcode); |
| | | rMiddleware.setState(2L); |
| | | daTileMatchMiddlewareService.updateDaTileMatchMiddleware(rMiddleware); |
| | | } |
| | | return rMiddleware; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.tileMatchMiddleware.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.jcdm.common.annotation.Excel; |
| | | import com.jcdm.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * æ´»å¡è¿æé
ç¦ä¸é´å¯¹è±¡ da_tile_match_middleware |
| | | * |
| | | * @author yyt |
| | | * @date 2024-05-28 |
| | | */ |
| | | public class DaTileMatchMiddleware extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ID */ |
| | | private Long id; |
| | | |
| | | /** 产åSNå· */ |
| | | @Excel(name = "产åSNå·") |
| | | private String sfcCode; |
| | | |
| | | /** æçå· */ |
| | | @Excel(name = "æçå·") |
| | | private String palletNo; |
| | | |
| | | /** æ²è½´ç */ |
| | | @Excel(name = "æ²è½´ç ") |
| | | private String crankshaftNo; |
| | | |
| | | /** ç¶æ */ |
| | | @Excel(name = "ç¶æ") |
| | | private Long state; |
| | | |
| | | /** å¤æ³¨ */ |
| | | @Excel(name = "å¤æ³¨") |
| | | private String remarks; |
| | | |
| | | /** è¿æç */ |
| | | @Excel(name = "è¿æç ") |
| | | private String connectingrodNo; |
| | | |
| | | /** æ°ç¼¸ç¼å· */ |
| | | @Excel(name = "æ°ç¼¸ç¼å·") |
| | | private Long cylinder; |
| | | |
| | | public void setId(Long id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getId() |
| | | { |
| | | return id; |
| | | } |
| | | public void setSfcCode(String sfcCode) |
| | | { |
| | | this.sfcCode = sfcCode; |
| | | } |
| | | |
| | | public String getSfcCode() |
| | | { |
| | | return sfcCode; |
| | | } |
| | | public void setPalletNo(String palletNo) |
| | | { |
| | | this.palletNo = palletNo; |
| | | } |
| | | |
| | | public String getPalletNo() |
| | | { |
| | | return palletNo; |
| | | } |
| | | public void setCrankshaftNo(String crankshaftNo) |
| | | { |
| | | this.crankshaftNo = crankshaftNo; |
| | | } |
| | | |
| | | public String getCrankshaftNo() |
| | | { |
| | | return crankshaftNo; |
| | | } |
| | | public void setState(Long state) |
| | | { |
| | | this.state = state; |
| | | } |
| | | |
| | | public Long getState() |
| | | { |
| | | return state; |
| | | } |
| | | public void setRemarks(String remarks) |
| | | { |
| | | this.remarks = remarks; |
| | | } |
| | | |
| | | public String getRemarks() |
| | | { |
| | | return remarks; |
| | | } |
| | | public void setConnectingrodNo(String connectingrodNo) |
| | | { |
| | | this.connectingrodNo = connectingrodNo; |
| | | } |
| | | |
| | | public String getConnectingrodNo() |
| | | { |
| | | return connectingrodNo; |
| | | } |
| | | public void setCylinder(Long cylinder) |
| | | { |
| | | this.cylinder = cylinder; |
| | | } |
| | | |
| | | public Long getCylinder() |
| | | { |
| | | return cylinder; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("sfcCode", getSfcCode()) |
| | | .append("palletNo", getPalletNo()) |
| | | .append("crankshaftNo", getCrankshaftNo()) |
| | | .append("state", getState()) |
| | | .append("remarks", getRemarks()) |
| | | .append("connectingrodNo", getConnectingrodNo()) |
| | | .append("cylinder", getCylinder()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.tileMatchMiddleware.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.jcdm.main.da.tileMatchMiddleware.domain.DaTileMatchMiddleware; |
| | | |
| | | /** |
| | | * æ´»å¡è¿æé
ç¦ä¸é´Mapperæ¥å£ |
| | | * |
| | | * @author yyt |
| | | * @date 2024-05-28 |
| | | */ |
| | | public interface DaTileMatchMiddlewareMapper |
| | | { |
| | | /** |
| | | * æ¥è¯¢æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * |
| | | * @param id æ´»å¡è¿æé
ç¦ä¸é´ä¸»é® |
| | | * @return æ´»å¡è¿æé
ç¦ä¸é´ |
| | | */ |
| | | public DaTileMatchMiddleware selectDaTileMatchMiddlewareById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢æ´»å¡è¿æé
ç¦ä¸é´å表 |
| | | * |
| | | * @param daTileMatchMiddleware æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * @return æ´»å¡è¿æé
ç¦ä¸é´éå |
| | | */ |
| | | public List<DaTileMatchMiddleware> selectDaTileMatchMiddlewareList(DaTileMatchMiddleware daTileMatchMiddleware); |
| | | |
| | | /** |
| | | * æ°å¢æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * |
| | | * @param daTileMatchMiddleware æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * @return ç»æ |
| | | */ |
| | | public int insertDaTileMatchMiddleware(DaTileMatchMiddleware daTileMatchMiddleware); |
| | | |
| | | /** |
| | | * ä¿®æ¹æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * |
| | | * @param daTileMatchMiddleware æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * @return ç»æ |
| | | */ |
| | | public int updateDaTileMatchMiddleware(DaTileMatchMiddleware daTileMatchMiddleware); |
| | | |
| | | /** |
| | | * å é¤æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * |
| | | * @param id æ´»å¡è¿æé
ç¦ä¸é´ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDaTileMatchMiddlewareById(Long id); |
| | | |
| | | /** |
| | | * æ¹éå é¤æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDaTileMatchMiddlewareByIds(Long[] ids); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.tileMatchMiddleware.service; |
| | | |
| | | import java.util.List; |
| | | import com.jcdm.main.da.tileMatchMiddleware.domain.DaTileMatchMiddleware; |
| | | |
| | | /** |
| | | * æ´»å¡è¿æé
ç¦ä¸é´Serviceæ¥å£ |
| | | * |
| | | * @author yyt |
| | | * @date 2024-05-28 |
| | | */ |
| | | public interface IDaTileMatchMiddlewareService |
| | | { |
| | | /** |
| | | * æ¥è¯¢æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * |
| | | * @param id æ´»å¡è¿æé
ç¦ä¸é´ä¸»é® |
| | | * @return æ´»å¡è¿æé
ç¦ä¸é´ |
| | | */ |
| | | public DaTileMatchMiddleware selectDaTileMatchMiddlewareById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢æ´»å¡è¿æé
ç¦ä¸é´å表 |
| | | * |
| | | * @param daTileMatchMiddleware æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * @return æ´»å¡è¿æé
ç¦ä¸é´éå |
| | | */ |
| | | public List<DaTileMatchMiddleware> selectDaTileMatchMiddlewareList(DaTileMatchMiddleware daTileMatchMiddleware); |
| | | |
| | | /** |
| | | * æ°å¢æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * |
| | | * @param daTileMatchMiddleware æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * @return ç»æ |
| | | */ |
| | | public int insertDaTileMatchMiddleware(DaTileMatchMiddleware daTileMatchMiddleware); |
| | | |
| | | /** |
| | | * ä¿®æ¹æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * |
| | | * @param daTileMatchMiddleware æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * @return ç»æ |
| | | */ |
| | | public int updateDaTileMatchMiddleware(DaTileMatchMiddleware daTileMatchMiddleware); |
| | | |
| | | /** |
| | | * æ¹éå é¤æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * |
| | | * @param ids éè¦å é¤çæ´»å¡è¿æé
ç¦ä¸é´ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDaTileMatchMiddlewareByIds(Long[] ids); |
| | | |
| | | /** |
| | | * å é¤æ´»å¡è¿æé
ç¦ä¸é´ä¿¡æ¯ |
| | | * |
| | | * @param id æ´»å¡è¿æé
ç¦ä¸é´ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDaTileMatchMiddlewareById(Long id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.tileMatchMiddleware.service.impl; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.jcdm.main.da.tileMatchMiddleware.mapper.DaTileMatchMiddlewareMapper; |
| | | import com.jcdm.main.da.tileMatchMiddleware.domain.DaTileMatchMiddleware; |
| | | import com.jcdm.main.da.tileMatchMiddleware.service.IDaTileMatchMiddlewareService; |
| | | |
| | | /** |
| | | * æ´»å¡è¿æé
ç¦ä¸é´Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author yyt |
| | | * @date 2024-05-28 |
| | | */ |
| | | @Service |
| | | public class DaTileMatchMiddlewareServiceImpl implements IDaTileMatchMiddlewareService |
| | | { |
| | | @Autowired |
| | | private DaTileMatchMiddlewareMapper daTileMatchMiddlewareMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * |
| | | * @param id æ´»å¡è¿æé
ç¦ä¸é´ä¸»é® |
| | | * @return æ´»å¡è¿æé
ç¦ä¸é´ |
| | | */ |
| | | @Override |
| | | public DaTileMatchMiddleware selectDaTileMatchMiddlewareById(Long id) |
| | | { |
| | | return daTileMatchMiddlewareMapper.selectDaTileMatchMiddlewareById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ´»å¡è¿æé
ç¦ä¸é´å表 |
| | | * |
| | | * @param daTileMatchMiddleware æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * @return æ´»å¡è¿æé
ç¦ä¸é´ |
| | | */ |
| | | @Override |
| | | public List<DaTileMatchMiddleware> selectDaTileMatchMiddlewareList(DaTileMatchMiddleware daTileMatchMiddleware) |
| | | { |
| | | return daTileMatchMiddlewareMapper.selectDaTileMatchMiddlewareList(daTileMatchMiddleware); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * |
| | | * @param daTileMatchMiddleware æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertDaTileMatchMiddleware(DaTileMatchMiddleware daTileMatchMiddleware) |
| | | { |
| | | return daTileMatchMiddlewareMapper.insertDaTileMatchMiddleware(daTileMatchMiddleware); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * |
| | | * @param daTileMatchMiddleware æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateDaTileMatchMiddleware(DaTileMatchMiddleware daTileMatchMiddleware) |
| | | { |
| | | return daTileMatchMiddlewareMapper.updateDaTileMatchMiddleware(daTileMatchMiddleware); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤æ´»å¡è¿æé
ç¦ä¸é´ |
| | | * |
| | | * @param ids éè¦å é¤çæ´»å¡è¿æé
ç¦ä¸é´ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteDaTileMatchMiddlewareByIds(Long[] ids) |
| | | { |
| | | return daTileMatchMiddlewareMapper.deleteDaTileMatchMiddlewareByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * å é¤æ´»å¡è¿æé
ç¦ä¸é´ä¿¡æ¯ |
| | | * |
| | | * @param id æ´»å¡è¿æé
ç¦ä¸é´ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteDaTileMatchMiddlewareById(Long id) |
| | | { |
| | | return daTileMatchMiddlewareMapper.deleteDaTileMatchMiddlewareById(id); |
| | | } |
| | | } |
| | |
| | | package com.jcdm.main.da.tileMatchRules.controller; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.jcdm.main.da.paramCollection.domain.DaParamCollection; |
| | | import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService; |
| | | import com.jcdm.main.da.tileMatchMiddleware.domain.DaTileMatchMiddleware; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | import com.jcdm.common.utils.poi.ExcelUtil; |
| | | import com.jcdm.common.core.page.TableDataInfo; |
| | | |
| | | import static com.jcdm.main.plcserver.sub.OPCUaSubscription.miloService; |
| | | |
| | | /** |
| | | * é
ç¦è§åController |
| | | * |
| | |
| | | { |
| | | @Autowired |
| | | private IDaTileMatchRulesService daTileMatchRulesService; |
| | | |
| | | @Autowired |
| | | public IDaParamCollectionService daParamCollectionService; |
| | | |
| | | /** |
| | | * æ¥è¯¢é
ç¦è§åå表() |
| | |
| | | { |
| | | return toAjax(daTileMatchRulesService.deleteDaTileMatchRulesByIds(ids)); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('da:tileMatchRules:query')") |
| | | @GetMapping(value = "/barcode") |
| | | public String setBarcode(String barcode,String locationCode) { |
| | | String XT=""; |
| | | try { |
| | | //Object SNCodeObject = miloService.readFromOpcUa("CFL4HX."+locationCode+".Code1").getValue(); |
| | | Object SNCodeObject = miloService.readFromOpcUa("CFL4HX.HOP040.Code1").getValue(); |
| | | if (null == SNCodeObject){ |
| | | //SNCodeObject = miloService.readFromOpcUa("CFL4HX."+locationCode+ ".Code").getValue(); |
| | | SNCodeObject = miloService.readFromOpcUa("CFL4HX.HOP040.Code").getValue(); |
| | | } |
| | | if (null != SNCodeObject){ |
| | | String SNCode = SNCodeObject.toString(); |
| | | |
| | | //æå
¥æ°æ® |
| | | DaParamCollection saveData = new DaParamCollection(); |
| | | saveData.setSfcCode(SNCode); |
| | | saveData.setParamValue(barcode); |
| | | saveData.setLocationCode(locationCode); |
| | | saveData.setParamCode("CZM"); |
| | | saveData.setParamName("æ²è½´"); |
| | | daParamCollectionService.insertDaParamCollection(saveData); |
| | | |
| | | DaParamCollection ParamCollection = new DaParamCollection(); |
| | | ParamCollection.setSfcCode(SNCode); |
| | | List<DaParamCollection> DaParamCollectionlist=daParamCollectionService.selectDaParamCollectionList(ParamCollection); |
| | | List<DaParamCollection> XTParamCollection = DaParamCollectionlist.stream().filter(x -> "ç®±ä½".equals(x.getParamName())).collect(Collectors.toList()); |
| | | if (CollUtil.isNotEmpty(XTParamCollection)){ |
| | | DaParamCollection lastOne = XTParamCollection.get(0); |
| | | XT = lastOne.getParamValue(); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return XT; |
| | | } |
| | | } |
| | |
| | | SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP060.Code").getValue(); |
| | | } |
| | | if (null != SNCodeObject){ |
| | | String XT=""; |
| | | String CZ=""; |
| | | String SNCode = SNCodeObject.toString(); |
| | | passingStationCollectionServiceImpl.sendMessage("P0SQ0-01FZ01-1000;T231224116;DBBBBA*P0SQ0-041000-1002;T2312020675;DAABBA;S500003","OP060"); |
| | | DaParamCollection ParamCollection = new DaParamCollection(); |
| | | ParamCollection.setSfcCode(SNCode); |
| | | List<DaParamCollection> DaParamCollectionlist=daParamCollectionService.selectDaParamCollectionList(ParamCollection); |
| | | List<DaParamCollection> XTParamCollection = DaParamCollectionlist.stream().filter(x -> "ç®±ä½".equals(x.getParamName())).collect(Collectors.toList()); |
| | | if (CollUtil.isNotEmpty(XTParamCollection)){ |
| | | DaParamCollection lastOne = XTParamCollection.get(0); |
| | | XT = lastOne.getParamValue(); |
| | | } |
| | | List<DaParamCollection> CZParamCollection = DaParamCollectionlist.stream().filter(x -> "æ²è½´".equals(x.getParamName())).collect(Collectors.toList()); |
| | | if (CollUtil.isNotEmpty(CZParamCollection)){ |
| | | DaParamCollection lastOne = CZParamCollection.get(0); |
| | | CZ = lastOne.getParamValue(); |
| | | } |
| | | passingStationCollectionServiceImpl.sendMessage(XT+"*"+CZ,"OP060"); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (StrUtil.isNotBlank(a)){ |
| | | int input = Integer.parseInt(a); |
| | | ReadWriteEntity entity = new ReadWriteEntity(parts[0]+"."+parts[1]+".CodeCheckFeed", input); |
| | | logger.info("-------çå¬å°,{}çCodeCheckçä¿¡å·",Node); |
| | | logger.info("åå¨æºå·ï¼{},çå¬å°{}çCodeCheckçä¿¡å·",SNCode,Node); |
| | | miloService.writeToOpcByte(entity); |
| | | logger.info("çå¬å°è¿åcodecheckfeedä¿¡å·ï¼{}",entity); |
| | | //é¦ç«ä¼ è¾è®¢åå· |
| | |
| | | .getAsJsonObject("ET_DATA"); |
| | | return etData.toString(); |
| | | } |
| | | /** |
| | | * æ¹å¼--è´° |
| | | * 使ç¨hutoolå·¥å
·å
ä¸çå·¥å
·è½¬å |
| | | * @param xmlStr |
| | | * @return |
| | | */ |
| | | public static String xmlToJSON1(String xmlStr){ |
| | | String status = ""; |
| | | if(xmlStr.contains("EV_MESSAGE")){ |
| | | JSONObject jsonObject1 = cn.hutool.json.XML.toJSONObject(xmlStr, true); |
| | | |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | JsonNode rootNode = null; |
| | | try { |
| | | rootNode = objectMapper.readTree(String.valueOf(jsonObject1)); |
| | | } catch (JsonProcessingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | String evStatus = rootNode |
| | | .path("SOAP:Envelope") |
| | | .path("SOAP:Body") |
| | | .path("n0:ZPP_BC_001.Response") |
| | | .path("EV_MESSAGE") |
| | | .asText(); |
| | | status = evStatus; |
| | | } |
| | | return status; |
| | | } |
| | | |
| | | /** |
| | | * æ¹å¼--è´° |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.jcdm.main.bs.orderScheduling.mapper.BsOrderSchedulingMapper"> |
| | | |
| | | |
| | | <resultMap type="BsOrderScheduling" id="BsOrderSchedulingResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="orderNo" column="order_no" /> |
| | |
| | | |
| | | <select id="selectBsOrderSchedulingList" parameterType="BsOrderScheduling" resultMap="BsOrderSchedulingResult"> |
| | | <include refid="selectBsOrderSchedulingVo"/> |
| | | <where> |
| | | <where> |
| | | <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if> |
| | | <if test="engineNo != null and engineNo != ''"> and engine_no = #{engineNo}</if> |
| | | <if test="productType != null and productType != ''"> and product_type = #{productType}</if> |
| | |
| | | <if test="operator != null and operator != ''"> and operator = #{operator}</if> |
| | | <if test="operateTime != null and operateTime != ''"> and operate_time = #{operateTime}</if> |
| | | <if test="status != null and status != ''"> and status = #{status}</if> |
| | | <if test="spareField1 != null and spareField1 != ''"> and spare_field_1 = #{spareField1}</if> |
| | | <if test="spareField2 != null and spareField2 != ''"> and spare_field_2 = #{spareField2}</if> |
| | | <if test="spareField1 != null and spareField1 != ''"> and isnull(spare_field_1,'') != #{spareField1}</if> |
| | | <if test="spareField2 != null and spareField2 != ''"> and isnull(spare_field_2,'') != #{spareField2}</if> |
| | | <if test="spareField3 != null and spareField3 != ''"> and spare_field_3 = #{spareField3}</if> |
| | | <if test="spareField4 != null and spareField4 != ''"> and spare_field_4 = #{spareField4}</if> |
| | | <if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if> |
| | |
| | | </where> |
| | | order by create_time DESC |
| | | </select> |
| | | |
| | | |
| | | <select id="selectBsOrderSchedulingById" parameterType="Long" resultMap="BsOrderSchedulingResult"> |
| | | <include refid="selectBsOrderSchedulingVo"/> |
| | | where id = #{id} |
| | |
| | | <if test="finalAssemblyOfflineTime != null">final_assembly_offline_time,</if> |
| | | <if test="cvtLaunchTime != null">cvt_launch_time,</if> |
| | | <if test="cvtOfflineTime != null">cvt_offline_time,</if> |
| | | </trim> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="orderNo != null">#{orderNo},</if> |
| | | <if test="engineNo != null">#{engineNo},</if> |
| | |
| | | </delete> |
| | | |
| | | <delete id="deleteBsOrderSchedulingByIds" parameterType="String"> |
| | | delete from bs_order_scheduling where id in |
| | | delete from bs_order_scheduling where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.jcdm.main.da.tileMatchMiddleware.mapper.DaTileMatchMiddlewareMapper"> |
| | | <resultMap type="DaTileMatchMiddleware" id="DaTileMatchMiddlewareResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="sfcCode" column="sfc_code" /> |
| | | <result property="palletNo" column="Pallet_no" /> |
| | | <result property="crankshaftNo" column="crankshaft_no" /> |
| | | <result property="state" column="state" /> |
| | | <result property="remarks" column="remarks" /> |
| | | <result property="connectingrodNo" column="connectingRod_no" /> |
| | | <result property="cylinder" column="cylinder" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectDaTileMatchMiddlewareVo"> |
| | | select id, sfc_code, Pallet_no, crankshaft_no, state, remarks, connectingRod_no, cylinder from da_tile_match_middleware |
| | | </sql> |
| | | |
| | | <select id="selectDaTileMatchMiddlewareList" parameterType="DaTileMatchMiddleware" resultMap="DaTileMatchMiddlewareResult"> |
| | | <include refid="selectDaTileMatchMiddlewareVo"/> |
| | | <where> |
| | | <if test="sfcCode != null and sfcCode != ''"> and sfc_code = #{sfcCode}</if> |
| | | <if test="palletNo != null and palletNo != ''"> and Pallet_no = #{palletNo}</if> |
| | | <if test="crankshaftNo != null and crankshaftNo != ''"> and crankshaft_no = #{crankshaftNo}</if> |
| | | <if test="state != null "> and state = #{state}</if> |
| | | <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> |
| | | <if test="connectingrodNo != null and connectingrodNo != ''"> and connectingRod_no = #{connectingrodNo}</if> |
| | | <if test="cylinder != null "> and cylinder = #{cylinder}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectDaTileMatchMiddlewareById" parameterType="Long" resultMap="DaTileMatchMiddlewareResult"> |
| | | <include refid="selectDaTileMatchMiddlewareVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertDaTileMatchMiddleware" parameterType="DaTileMatchMiddleware"> |
| | | insert into da_tile_match_middleware |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="sfcCode != null">sfc_code,</if> |
| | | <if test="palletNo != null">Pallet_no,</if> |
| | | <if test="crankshaftNo != null">crankshaft_no,</if> |
| | | <if test="state != null">state,</if> |
| | | <if test="remarks != null">remarks,</if> |
| | | <if test="connectingrodNo != null">connectingRod_no,</if> |
| | | <if test="cylinder != null">cylinder,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="sfcCode != null">#{sfcCode},</if> |
| | | <if test="palletNo != null">#{palletNo},</if> |
| | | <if test="crankshaftNo != null">#{crankshaftNo},</if> |
| | | <if test="state != null">#{state},</if> |
| | | <if test="remarks != null">#{remarks},</if> |
| | | <if test="connectingrodNo != null">#{connectingrodNo},</if> |
| | | <if test="cylinder != null">#{cylinder},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateDaTileMatchMiddleware" parameterType="DaTileMatchMiddleware"> |
| | | update da_tile_match_middleware |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="sfcCode != null">sfc_code = #{sfcCode},</if> |
| | | <if test="palletNo != null">Pallet_no = #{palletNo},</if> |
| | | <if test="crankshaftNo != null">crankshaft_no = #{crankshaftNo},</if> |
| | | <if test="state != null">state = #{state},</if> |
| | | <if test="remarks != null">remarks = #{remarks},</if> |
| | | <if test="connectingrodNo != null">connectingRod_no = #{connectingrodNo},</if> |
| | | <if test="cylinder != null">cylinder = #{cylinder},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteDaTileMatchMiddlewareById" parameterType="Long"> |
| | | delete from da_tile_match_middleware where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteDaTileMatchMiddlewareByIds" parameterType="String"> |
| | | delete from da_tile_match_middleware where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
| | |
| | | <if test="tileName != null and tileName != ''"> and tile_name like concat('%', #{tileName}, '%')</if> |
| | | <if test="axisParameterNoPosition != null "> and axis_parameter_no_position = #{axisParameterNoPosition}</if> |
| | | <if test="neckParameterPosition != null "> and neck_parameter_position = #{neckParameterPosition}</if> |
| | | <if test="axisValue != null and axisValue != ''"> and axis_value = SUBSTRING(#{axisValue}, axis_parameter_no_position, 1)</if> |
| | | <if test="neckValue != null and neckValue != ''"> and neck_value = SUBSTRING(#{neckValue}, neck_parameter_position, 1)</if> |
| | | <if test="axisValue != null and axisValue != ''"> and axis_value = SUBSTRING(#{axisValue}, axis_parameter_no_position+1, 1)</if> |
| | | <if test="neckValue != null and neckValue != ''"> and neck_value = SUBSTRING(#{neckValue}, neck_parameter_position+1, 1)</if> |
| | | <if test="tileColor != null and tileColor != ''"> and tile_color = #{tileColor}</if> |
| | | <if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if> |
| | | <if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if> |
| | |
| | | BsOrderScheduling bsOrderScheduling = new BsOrderScheduling(); |
| | | bsOrderScheduling.setReport10("0"); |
| | | List<BsOrderScheduling> bsOrderSchedulings = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling); |
| | | String status=""; |
| | | String ev_meassage=""; |
| | | for (BsOrderScheduling orderScheduling : bsOrderSchedulings) { |
| | | String xmlResult = ReceivingServices.getInterfaceInformationXml(url, getProductionPlanInformationXml(orderScheduling.getOrderNo(), "0010")); |
| | | String status = ReceivingServices.xmlToJSON3(xmlResult); |
| | | if(status.equals("1")){ |
| | | try { |
| | | String xmlResult = ReceivingServices.getInterfaceInformationXml(url, getProductionPlanInformationXml(orderScheduling.getOrderNo(), "0010")); |
| | | ev_meassage=ReceivingServices.xmlToJSON1(xmlResult); |
| | | status = ReceivingServices.xmlToJSON3(xmlResult); |
| | | } catch (Exception e) { |
| | | status="3"; |
| | | } |
| | | if(status.equals("1")) { |
| | | orderScheduling.setReport10("1"); |
| | | int i = bsOrderSchedulingService.updateBsOrderScheduling(orderScheduling); |
| | | System.out.println("æ´æ°ç¶ææå"); |
| | | //logger.info("{}åç®±æ¥å·¥æå",orderScheduling.getOrderNo()); |
| | | logger.info("{}åç®±æ¥å·¥æå",orderScheduling.getOrderNo()); |
| | | }else { |
| | | if(StringUtils.isEmpty(orderScheduling.getSpareField1())){ |
| | | orderScheduling.setSpareField1("1"); |
| | | bsOrderSchedulingService.updateBsOrderScheduling(orderScheduling); |
| | | }else{ |
| | | if(Integer.valueOf(orderScheduling.getSpareField1())+1>=3) { |
| | | //累计æ¥å·¥å¼å¸¸è¶
è¿3次 |
| | | orderScheduling.setReport10("3"); |
| | | orderScheduling.setSpareField1(String.valueOf(Integer.valueOf(orderScheduling.getSpareField1()) + 1)); |
| | | }else { |
| | | orderScheduling.setSpareField1(String.valueOf(Integer.valueOf(orderScheduling.getSpareField1()) + 1)); |
| | | } |
| | | bsOrderSchedulingService.updateBsOrderScheduling(orderScheduling); |
| | | } |
| | | if(status.equals("3")) |
| | | logger.info("{}åç®±æ¥å·¥å 为ç½ç»åå ï¼æ¥å·¥å¤±è´¥ï¼",orderScheduling.getOrderNo()); |
| | | else |
| | | logger.info("{}åç®±æ¥å·¥å¤±è´¥,åå ï¼{}",orderScheduling.getOrderNo(),ev_meassage); |
| | | } |
| | | } |
| | | } |
| | |
| | | BsOrderScheduling bsOrderScheduling = new BsOrderScheduling(); |
| | | bsOrderScheduling.setReport20("0"); |
| | | List<BsOrderScheduling> bsOrderSchedulings = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling); |
| | | String status=""; |
| | | String ev_meassage=""; |
| | | for (BsOrderScheduling orderScheduling : bsOrderSchedulings) { |
| | | String xmlResult = ReceivingServices.getInterfaceInformationXml(url, getProductionPlanInformationXml(orderScheduling.getOrderNo(), "0020")); |
| | | String status = ReceivingServices.xmlToJSON3(xmlResult); |
| | | try { |
| | | String xmlResult = ReceivingServices.getInterfaceInformationXml(url, getProductionPlanInformationXml(orderScheduling.getOrderNo(), "0020")); |
| | | ev_meassage=ReceivingServices.xmlToJSON1(xmlResult); |
| | | status = ReceivingServices.xmlToJSON3(xmlResult); |
| | | } catch (Exception e) { |
| | | status="3"; |
| | | } |
| | | if(status.equals("1")){ |
| | | orderScheduling.setReport20("1"); |
| | | int i = bsOrderSchedulingService.updateBsOrderScheduling(orderScheduling); |
| | | System.out.println("æ´æ°ç¶ææå"); |
| | | //logger.info("{}æ»è£
æ¥å·¥æå",orderScheduling.getOrderNo()); |
| | | logger.info("{}æ»è£
æ¥å·¥æå",orderScheduling.getOrderNo()); |
| | | }else { |
| | | if(StringUtils.isEmpty(orderScheduling.getSpareField2())){ |
| | | orderScheduling.setSpareField2("1"); |
| | | bsOrderSchedulingService.updateBsOrderScheduling(orderScheduling); |
| | | }else{ |
| | | if(Integer.valueOf(orderScheduling.getSpareField2())+1>=3) { |
| | | //累计æ¥å·¥å¼å¸¸è¶
è¿3次 |
| | | orderScheduling.setReport20("3"); |
| | | orderScheduling.setSpareField2(String.valueOf(Integer.valueOf(orderScheduling.getSpareField2()) + 1)); |
| | | }else{ |
| | | orderScheduling.setSpareField2(String.valueOf(Integer.valueOf(orderScheduling.getSpareField2()) + 1)); |
| | | } |
| | | bsOrderSchedulingService.updateBsOrderScheduling(orderScheduling); |
| | | if(status.equals("3")) |
| | | logger.info("{}æ»è£
æ¥å·¥å 为ç½ç»åå ï¼æ¥å·¥å¤±è´¥ï¼",orderScheduling.getOrderNo()); |
| | | else |
| | | logger.info("{}æ»è£
æ¥å·¥å¤±è´¥,åå ï¼{}",orderScheduling.getOrderNo(),ev_meassage); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
| | | export function setBarcode(param) { |
| | | return request({ |
| | | url: '/da/tileMatchRules/barcode', |
| | | method: 'get', |
| | | params: param |
| | | }) |
| | | } |
| | |
| | | } |
| | | |
| | | // æ¥è¯¢äº¤äºä¿¡å·é
ç½®è¯¦ç» |
| | | export function setBarcode(barcode,locationCode) { |
| | | export function setBarcode1(param) { |
| | | return request({ |
| | | url: '/da/opcuaconfig/barcode/' + barcode+'/'+locationCode, |
| | | method: 'get' |
| | | url: '/da/opcuaconfig/barcode1', |
| | | method: 'get', |
| | | params: param |
| | | }) |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢æ´»å¡è¿æé
ç¦ä¸é´å表 |
| | | export function listTileMatchMiddleware(query) { |
| | | return request({ |
| | | url: '/da/tileMatchMiddleware/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢æ´»å¡è¿æé
ç¦ä¸é´è¯¦ç» |
| | | export function getTileMatchMiddleware(id) { |
| | | return request({ |
| | | url: '/da/tileMatchMiddleware/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢æ´»å¡è¿æé
ç¦ä¸é´ |
| | | export function addTileMatchMiddleware(data) { |
| | | return request({ |
| | | url: '/da/tileMatchMiddleware', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹æ´»å¡è¿æé
ç¦ä¸é´ |
| | | export function updateTileMatchMiddleware(data) { |
| | | return request({ |
| | | url: '/da/tileMatchMiddleware', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å é¤æ´»å¡è¿æé
ç¦ä¸é´ |
| | | export function delTileMatchMiddleware(id) { |
| | | return request({ |
| | | url: '/da/tileMatchMiddleware/' + id, |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
| | | export function setBarcodeup(param) { |
| | | return request({ |
| | | url: '/da/tileMatchMiddleware/barcodeup', |
| | | method: 'get', |
| | | params: param |
| | | }) |
| | | } |
| | | |
| | | export function setBarcode(param) { |
| | | return request({ |
| | | url: '/da/tileMatchMiddleware/barcode', |
| | | method: 'get', |
| | | params: param |
| | | }) |
| | | } |
| | |
| | | </el-form-item> |
| | | <br/> |
| | | <el-form-item label="åç®±æ¥å·¥" prop="report10"> |
| | | <el-input |
| | | <el-select |
| | | v-model="queryParams.report10" |
| | | placeholder="请è¾å
¥åç®±æ¥å·¥" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | @keyup.enter.native="handleQuery"> |
| | | <el-option |
| | | v-for="dict in dict.type.workreportingstatus" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ»è£
æ¥å·¥" prop="report20"> |
| | | <el-input |
| | | <el-select |
| | | v-model="queryParams.report20" |
| | | placeholder="请è¾å
¥æ»è£
æ¥å·¥" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | @keyup.enter.native="handleQuery"> |
| | | |
| | | <el-option |
| | | v-for="dict in dict.type.workreportingstatus" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="CVTæ¥å·¥" prop="report30"> |
| | | <el-input |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="åç®±æ¥å·¥" align="center" prop="report10"> |
| | | |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.workreportingstatus" :value="scope.row.report10"/> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="æ»è£
æ¥å·¥" align="center" prop="report20"> |
| | | |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.workreportingstatus" :value="scope.row.report20"/> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="CVTæ¥å·¥" align="center" prop="report30"> |
| | | |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="æ¥å·¥å¼å¸¸" align="center" prop="report30"> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="åç®±ä¸çº¿æ¶é´" align="center" prop="boxClosingOnlineTime" width="160"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.boxClosingOnlineTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
| | |
| | | |
| | | export default { |
| | | name: "OrderScheduling", |
| | | dicts: ['order_scheduling_produce_status','quality_status','print_status','material_type'], |
| | | dicts: ['order_scheduling_produce_status','quality_status','print_status','material_type','workreportingstatus'], |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | |
| | | <div style="width: 100%"> |
| | | <el-card class="box-card" > |
| | | <el-form :model="from" size="large" :inline="true" label-width="68px" @submit.native.prevent> |
| | | <!-- <el-form-item label="ç®±ä½ç :" prop="scanObject1" >--> |
| | | <!-- <el-input--> |
| | | <!-- style="width: 350px"--> |
| | | <!-- v-model="from.scanObject1"--> |
| | | <!-- placeholder="请è¾å
¥ç®±ä½ç "--> |
| | | <!-- clearable--> |
| | | <!-- @keyup.enter.native="handleQuery"--> |
| | | <!-- @input="handleQuery"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label-width="200" label="平衡轴ç " :prop="from.scanObject2" style="align-content: center"> |
| | | <input v-model="from.scanObject2" |
| | | ref="inputdata" |
| | |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="è½´å称:" prop="axisName" > |
| | | <el-select v-model="from.axisName" placeholder="" clearable style="width: 125px"> |
| | | <el-option |
| | | v-for="dict in dict.type.axisname" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="é¢å称:" prop="neckName" > |
| | | <el-select v-model="from.neckName" placeholder="" clearable style="width: 125px"> |
| | | <el-option |
| | | v-for="dict in dict.type.neckname" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | <el-descriptions-item label="平衡轴ç "> |
| | | <span>{{queryParams.scanObject2}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="è½´å称"> |
| | | <span>{{queryParams.axisName}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="é¢å称"> |
| | | <span>{{queryParams.neckName}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ç¦å称"> |
| | | <span>{{queryParams.tileName}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="é
ç¦é¢è²"> |
| | | <span style="color: #FFFFFF;" :style="{ backgroundColor: queryParams.tileColor }">{{queryParams.tileColor}}</span> |
| | | <span v-for="(word, index) in queryParams.words" :key="index" :style="{ backgroundColor: queryParams.colors[index],fontSize: '30px',}">{{ word }}</span> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <el-divider></el-divider> |
| | |
| | | <script> |
| | | import VueQr from 'vue-qr' |
| | | import { listTileMatchRules, getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules } from "@/api/main/bs/tileMatchRules/tileMatchRules"; |
| | | import {setBarcode} from "@/api/main/bs/tileMatchRules/tileMatchRules"; |
| | | export default { |
| | | name: "index", |
| | | dicts: ['colour_hex','productseries','axisname','neckname','tilename'], |
| | |
| | | from:{ |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | productSeries: null, |
| | | //scanObject1: null, |
| | | //scanObject1: 'P0SQ0-01FZ01-1000;T231224116;DBBBBA', |
| | | scanObject2: '', |
| | | productSeries: '380Y', |
| | | scanObject1: null, |
| | | scanObject2: 'P0NYK0410001000;T231107031;D2222232;S500003', |
| | | axisName: null, |
| | | neckName: null, |
| | | tileName: null, |
| | | tileName: '平衡轴ç¦', |
| | | axisParameterNoPosition: null, |
| | | neckParameterPosition: null, |
| | | axisValue: null, |
| | |
| | | pageSize: 10, |
| | | productSeries: null, |
| | | scanObject1: null, |
| | | // scanObject1: 'P0SQ0-01FZ01-1000;T231224116;DBBBBA', |
| | | scanObject2: null, |
| | | scanObject2: 'P0NYK0410001000;T231107031;D2222232;S500003', |
| | | axisName: null, |
| | | neckName: null, |
| | | tileName: null, |
| | | words: ['------', '------', ], |
| | | colors: ['#FFFFFF', '#FFFFFF'], |
| | | axisParameterNoPosition: null, |
| | | neckParameterPosition: null, |
| | | axisValue: null, |
| | |
| | | this.scannerFlag = true |
| | | console.log('æ¡ç ï¼',this.from.scanObject2) |
| | | //æ«æå®æ |
| | | if (typeof this.from.scanObject2 !== 'undefined') { |
| | | console.log('æ¡ç ï¼',this.from.scanObject2,'HOP040') |
| | | setBarcode({barcode:this.from.scanObject2,locationCode:'HOP040'}).then(res =>{ |
| | | console.log('res',res) |
| | | this.from.scanObject1=res |
| | | }) |
| | | } |
| | | this.handleQuery() |
| | | } |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | |
| | | this.clear(); |
| | | |
| | | if(this.from.scanObject1 !== null && this.from.scanObject2 !== null |
| | | && this.from.axisName !== null && this.from.axisName !== "" |
| | | && this.from.neckName !== null && this.from.neckName !== "" |
| | | && this.from.tileName !== null && this.from.tileName !== "" |
| | | // && this.from.axisName !== null && this.from.axisName !== "" |
| | | // && this.from.neckName !== null && this.from.neckName !== "" |
| | | // && this.from.tileName !== null && this.from.tileName !== "" |
| | | && this.from.productSeries !== null && this.from.productSeries !== "") |
| | | { |
| | | this.axisValueextracted(); |
| | |
| | | } |
| | | } |
| | | else{ |
| | | console.log("æç´¢æ¡ä»¶",this.from.scanObject1 ,this.from.scanObject2) |
| | | const h = this.$createElement; |
| | | this.$message({ |
| | | message: h('p',null, [ |
| | |
| | | } |
| | | console.log(queryParams) |
| | | listTileMatchRules(queryParams).then(response => { |
| | | this.queryParams.tileColor = response.rows[0].tileColor; |
| | | // this.queryParams.tileColor = response.rows[0].tileColor; |
| | | this.queryParams.words= ['------', '------'] |
| | | this.queryParams.colors= ['#FFFFFF', '#FFFFFF'] |
| | | for (var i=0;i<response.rows.length;i++){ |
| | | this.queryParams.colors[i]=response.rows[i].tileColor; |
| | | this.queryParams.words[i]=response.rows[i].tileName; |
| | | } |
| | | console.log('é¢è²ï¼',response) |
| | | }); |
| | | }, |
| | | clear(){ |
| | |
| | | <div class="app-container"> |
| | | <div style="width: 100%"> |
| | | <el-card class="box-card" > |
| | | <el-form :model="from" ref="queryForm" :inline="true" > |
| | | <el-form :model="from" size="large" :inline="true" label-width="68px" @submit.native.prevent> |
| | | <el-form-item label="æçç :" prop="scanObject1" > |
| | | <el-input |
| | | style="width: 350px" |
| | |
| | | @input="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="è¿æç :" prop="scanObject2" > |
| | | <el-input |
| | | style="width: 350px" |
| | | v-model="from.scanObject2" |
| | | placeholder="请è¾å
¥è¿æç " |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | @input="handleQuery" |
| | | <el-form-item label-width="200" label="è¿æç " :prop="from.scanObject2" style="align-content: center"> |
| | | <input v-model="from.scanObject2" |
| | | ref="inputdata" |
| | | style="height: 39px; width: 300px" |
| | | placeholder="请è¾å
¥è¿æç " |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | <el-option |
| | | |
| | | v-for="dict in dict.type.productseries" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="è½´å称:" prop="axisName" > |
| | | <el-select v-model="from.axisName" placeholder="" clearable style="width: 125px"> |
| | | <el-option |
| | | v-for="dict in dict.type.axisname" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="é¢å称:" prop="neckName" > |
| | | <el-select v-model="from.neckName" placeholder="" clearable style="width: 125px"> |
| | | <el-option |
| | | v-for="dict in dict.type.neckname" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | |
| | | <el-descriptions-item label="æºå"> |
| | | <span>{{queryParams.productSeries}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ç®±ä½ç "> |
| | | <el-descriptions-item label="æ²è½´ç "> |
| | | <span>{{queryParams.scanObject1}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="æ²è½´ç "> |
| | | <el-descriptions-item label="è¿æç "> |
| | | <span>{{queryParams.scanObject2}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="è½´å称"> |
| | | <span>{{queryParams.axisName}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="é¢å称"> |
| | | <span>{{queryParams.neckName}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ç¦å称"> |
| | | <span>{{queryParams.tileName}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="éé"> |
| | | <span>{{queryParams.weight}}</span> |
| | | <el-descriptions-item label="è¿æç "> |
| | | <span>{{queryParams.axisName}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="é
ç¦é¢è²"> |
| | | <span style="color: #FFFFFF;" :style="{ backgroundColor: queryParams.tileColor }">{{queryParams.tileColor}}</span> |
| | |
| | | </template> |
| | | <script> |
| | | import VueQr from 'vue-qr' |
| | | import { listTileMatchRules, getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules } from "@/api/main/bs/tileMatchRules/tileMatchRules"; |
| | | import {setBarcode} from "@/api/main/da/tileMatchMiddleware/tileMatchMiddleware"; |
| | | import {listTileMatchRules, getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules} from "@/api/main/bs/tileMatchRules/tileMatchRules"; |
| | | export default { |
| | | name: "index", |
| | | dicts: ['colour_hex','productseries','axisname','neckname','tilename'], |
| | |
| | | }, |
| | | data(){ |
| | | return{ |
| | | scannerFlag: false, |
| | | loading: true, |
| | | tileMatchKbList: [], |
| | | qrCode: '', |
| | |
| | | from:{ |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | productSeries: null, |
| | | productSeries:'380Y', |
| | | scanObject1: null, |
| | | //scanObject1: 'P0SQ0-01FZ01-1000;T231224116;DBBBBA', |
| | | scanObject2: 'P0SQ0-041000-1002;T2312020675;DAABBA;S500003', |
| | | scanObject2: null, |
| | | axisName: null, |
| | | neckName: null, |
| | | tileName: null, |
| | | tileName: 'è¿æç¦', |
| | | axisParameterNoPosition: null, |
| | | neckParameterPosition: null, |
| | | axisValue: null, |
| | |
| | | pageSize: 10, |
| | | productSeries: null, |
| | | scanObject1: null, |
| | | // scanObject1: 'P0SQ0-01FZ01-1000;T231224116;DBBBBA', |
| | | scanObject2: null, |
| | | axisName: null, |
| | | neckName: null, |
| | |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.setFocus() |
| | | this.$refs.inputdata.addEventListener('keydown',this.handleScannerInput) |
| | | }, |
| | | beforeDestroy() { |
| | | this.$refs.inputdata.removeEventListener('keydown',this.handleScannerInput) |
| | | }, |
| | | methods:{ |
| | | refresh() { |
| | | location.reload(); |
| | | }, |
| | | setFocus(){ |
| | | this.$nextTick(()=>{ |
| | | this.$refs.inputdata.focus() |
| | | }) |
| | | }, |
| | | handleScannerInput(event){ |
| | | if (this.scannerFlag){ |
| | | this.from.scanObject2 = '' |
| | | this.$refs.inputdata.value = '' |
| | | this.scannerFlag = false |
| | | } |
| | | const input = event.target |
| | | const inputValue = input.value |
| | | this.from.scanObject2 = inputValue |
| | | if (event.key === 'Enter'){ |
| | | this.scannerFlag = true |
| | | //console.log('æ¡ç ï¼',this.from.scanObject2) |
| | | //æ«æå®æ |
| | | if (typeof this.from.scanObject2 !== 'undefined') { |
| | | setBarcode({barcode:this.from.scanObject2,locationCode:'HOP040'}).then(res =>{ |
| | | console.log('res',res) |
| | | this.queryParams.productSeries=res.sfcCode; |
| | | this.queryParams.scanObject1=res.crankshaftNo; |
| | | this.queryParams.axisName=res.cylinder; |
| | | this.from.scanObject1=this.queryParams.scanObject1 |
| | | this.queryParams.tileName=this.from.tileName; |
| | | this.queryParams.scanObject2=this.from.scanObject2; |
| | | //this.from.scanObject1=res |
| | | }) |
| | | } |
| | | this.handleQuery() |
| | | } |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.clear(); |
| | | |
| | | if(this.from.scanObject1 !== null && this.from.scanObject2 !== null |
| | | && this.from.axisName !== null && this.from.axisName !== "" |
| | | && this.from.neckName !== null && this.from.neckName !== "" |
| | | && this.from.tileName !== null && this.from.tileName !== "" |
| | | && this.from.productSeries !== null && this.from.productSeries !== "") |
| | | { |
| | | this.axisValueextracted(); |
| | |
| | | |
| | | // åç®±ä½ç 第ä¸æ®µä¸ºé
ç¦å¼ |
| | | axisValueextracted() { |
| | | const parts1 = this.from.scanObject1.split(";"); |
| | | const parts1 = this.from.scanObject2.split(";"); |
| | | if (parts1.length >= 3) { |
| | | //const axisValueextracted = parts1[2].substring(3,4); |
| | | const axisValueextracted = parts1[2]; |
| | |
| | | |
| | | //åæ²è½´ç 第ä¸æ®µä¸ºé
ç¦å¼ |
| | | neckValueextracted() { |
| | | const parts2 = this.from.scanObject2.split(";"); |
| | | const parts2 = this.from.scanObject1.split(";"); |
| | | if (parts2.length >= 3) { |
| | | //const neckValueextracted = parts2[2].substring(3,4); |
| | | const neckValueextracted = parts2[2]; |
| | |
| | | let queryParams = { |
| | | productSeries : this.queryParams.productSeries, |
| | | axisName : this.queryParams.axisName, |
| | | neckName : this.queryParams.neckName, |
| | | // neckName : this.queryParams.neckName, |
| | | tileName : this.queryParams.tileName, |
| | | axisValue: this.queryParams.axisValue, |
| | | neckValue: this.queryParams.neckValue, |
| | | } |
| | | console.log(queryParams) |
| | | console.log('åæ°ï¼',queryParams) |
| | | listTileMatchRules(queryParams).then(response => { |
| | | this.queryParams.tileColor = response.rows[0].tileColor; |
| | | }); |
| | |
| | | }, |
| | | insetFromToQueryParams(){ |
| | | this.queryParams.productSeries=this.from.productSeries; |
| | | this.queryParams.axisName=this.from.axisName; |
| | | //this.queryParams.axisName=this.from.axisName; |
| | | this.queryParams.neckName=this.from.neckName; |
| | | this.queryParams.tileName=this.from.tileName; |
| | | this.queryParams.scanObject1=this.from.scanObject1; |
| | |
| | | <span>{{queryParams.scanObject2}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ç»æ"> |
| | | <span style="color: #FFFFFF;" :style="{ backgroundColor: queryParams.tileColor }">{{queryParams.tileColor}}</span> |
| | | <span style="color: #FFFFFF;" :style="{ backgroundColor: queryParams.tileColor }">{{queryParams.words}}</span> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <el-divider></el-divider> |
| | |
| | | import VueQr from 'vue-qr' |
| | | import { listTileMatchRules, getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules } from "@/api/main/bs/tileMatchRules/tileMatchRules"; |
| | | import {listStationConf,getIp} from "@/api/main/sc/stationConf"; |
| | | import {setBarcodeup} from "@/api/main/da/tileMatchMiddleware/tileMatchMiddleware"; |
| | | export default { |
| | | name: "index", |
| | | dicts: ['colour_hex','productseries','axisname','neckname','tilename'], |
| | |
| | | productSeries: null, |
| | | scanObject1: null, |
| | | //scanObject1: 'P0SQ0-01FZ01-1000;T231224116;DBBBBA', |
| | | scanObject2: "", |
| | | scanObject2: null, |
| | | axisName: null, |
| | | neckName: null, |
| | | tileName: null, |
| | |
| | | neckParameterPosition: null, |
| | | axisValue: null, |
| | | neckValue: null, |
| | | words:"", |
| | | tileColor: null, |
| | | createUser: null, |
| | | updateUser: null, |
| | |
| | | this.from.scanObject2 = inputValue |
| | | if (event.key === 'Enter'){ |
| | | this.scannerFlag = true |
| | | console.log('æ¡ç ï¼',this.from.scanObject2) |
| | | //æ«æå®æ |
| | | if (typeof this.from.scanObject2 !== 'undefined'&& typeof this.locationCode !== 'undefined' ) { |
| | | setBarcodeup({barcode:this.from.scanObject2,locationCode:this.locationCode}).then(res => { |
| | | if (res===''){ |
| | | this.$message({ |
| | | message:res.msg, |
| | | type:'warning' |
| | | }) |
| | | }else { |
| | | this.$message({ |
| | | message:'æä½æå', |
| | | type:'success' |
| | | }) |
| | | console.log('è¿åï¼',res) |
| | | this.queryParams.productSeries=res.sfcCode; |
| | | this.queryParams.scanObject1=res.connectingRodNo; |
| | | this.queryParams.scanObject2=res.PalletNo; |
| | | this.queryParams.words="æ«ç æå"; |
| | | this.queryParams.tileColor='#00FF00'; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="è½´å称:" prop="axisName" > |
| | | <el-select v-model="from.axisName" placeholder="" clearable style="width: 125px"> |
| | | <el-option |
| | | v-for="dict in dict.type.axisname" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="é¢å称:" prop="neckName" > |
| | | <el-select v-model="from.neckName" placeholder="" clearable style="width: 125px"> |
| | | <el-option |
| | | v-for="dict in dict.type.neckname" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="è½´å称:" prop="axisName" >--> |
| | | <!-- <el-select v-model="from.axisName" placeholder="" clearable style="width: 125px">--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="dict in dict.type.axisname"--> |
| | | <!-- :key="dict.value"--> |
| | | <!-- :label="dict.label"--> |
| | | <!-- :value="dict.value"--> |
| | | <!-- @keyup.enter.native="handleQuery"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="é¢å称:" prop="neckName" >--> |
| | | <!-- <el-select v-model="from.neckName" placeholder="" clearable style="width: 125px">--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="dict in dict.type.neckname"--> |
| | | <!-- :key="dict.value"--> |
| | | <!-- :label="dict.label"--> |
| | | <!-- :value="dict.value"--> |
| | | <!-- @keyup.enter.native="handleQuery"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="ç¦å称:" prop="tileName" > |
| | | <el-select v-model="from.tileName" placeholder="" clearable style="width: 125px" > |
| | | <el-option |
| | |
| | | <el-descriptions-item label="æ²è½´ç "> |
| | | <span>{{queryParams.scanObject2}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="è½´å称"> |
| | | <span>{{queryParams.axisName}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="é¢å称"> |
| | | <span>{{queryParams.neckName}}</span> |
| | | </el-descriptions-item> |
| | | <!-- <el-descriptions-item label="è½´å称">--> |
| | | <!-- <span>{{queryParams.axisName}}</span>--> |
| | | <!-- </el-descriptions-item>--> |
| | | <!-- <el-descriptions-item label="é¢å称">--> |
| | | <!-- <span>{{queryParams.neckName}}</span>--> |
| | | <!-- </el-descriptions-item>--> |
| | | <el-descriptions-item label="ç¦å称"> |
| | | <span>{{queryParams.tileName}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="éé"> |
| | | <span>{{queryParams.weight}}</span> |
| | | </el-descriptions-item> |
| | | <!-- <el-descriptions-item label="éé">--> |
| | | <!-- <span>{{queryParams.weight}}</span>--> |
| | | <!-- </el-descriptions-item>--> |
| | | <el-descriptions-item label="é
ç¦é¢è²"> |
| | | <span style="color: #FFFFFF;" :style="{ backgroundColor: queryParams.tileColor }">{{queryParams.tileColor}}</span> |
| | | <span v-for="(word, index) in queryParams.words" :key="index" :style="{ backgroundColor: queryParams.colors[index],fontSize: '30px',}">{{ word }}</span> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <el-divider></el-divider> |
| | |
| | | from:{ |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | productSeries: null, |
| | | //scanObject1: null, |
| | | productSeries: '380Y', |
| | | // scanObject1: 'ONYL01FZ0120003023123;1206B0026;D2212BA', |
| | | // scanObject2: 'P0NYK0410001000;T231107031;D2222232;S500003', |
| | | scanObject1: null, |
| | | scanObject2: null, |
| | | axisName: null, |
| | | neckName: null, |
| | | tileName: null, |
| | | tileName: '主轴ç¦', |
| | | axisParameterNoPosition: null, |
| | | neckParameterPosition: null, |
| | | axisValue: null, |
| | |
| | | axisValue: null, |
| | | neckValue: null, |
| | | tileColor: null, |
| | | words: ['------', '------', '------', '------'], |
| | | colors: ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF'], |
| | | createUser: null, |
| | | updateUser: null, |
| | | state: null, |
| | |
| | | this.clear(); |
| | | |
| | | if(this.from.scanObject1 !== null && this.from.scanObject2 !== null |
| | | && this.from.axisName !== null && this.from.axisName !== "" |
| | | && this.from.neckName !== null && this.from.neckName !== "" |
| | | && this.from.tileName !== null && this.from.tileName !== "" |
| | | // && this.from.axisName !== null && this.from.axisName !== "" |
| | | // && this.from.neckName !== null && this.from.neckName !== "" |
| | | // && this.from.tileName !== null && this.from.tileName !== "" |
| | | && this.from.productSeries !== null && this.from.productSeries !== "") |
| | | { |
| | | this.axisValueextracted(); |
| | |
| | | } |
| | | console.log(queryParams) |
| | | listTileMatchRules(queryParams).then(response => { |
| | | this.queryParams.tileColor = response.rows[0].tileColor; |
| | | this.queryParams.words= ['------', '------', '------', '------'] |
| | | this.queryParams.colors= ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF'] |
| | | for (var i=0;i<response.rows.length;i++){ |
| | | this.queryParams.colors[i]=response.rows[i].tileColor; |
| | | this.queryParams.words[i]=response.rows[i].tileName; |
| | | } |
| | | console.log('é¢è²ï¼',response) |
| | | }); |
| | | }, |
| | | clear(){ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-input |
| | | οnkeyup="this.value=this.value.replace(/\D|/g,'')" |
| | | clearable |
| | | maxlength="116" |
| | | v-model="codeValue" |
| | | placeholder="请è¾å
¥æ¡å½¢ç " |
| | | /> |
| | | </template> |
| | | <script> |
| | | export default { |
| | | data(){ |
| | | return { |
| | | codeValue: "", |
| | | code: "", |
| | | lastTime: "", |
| | | nextTime: "", |
| | | lastCode: "", |
| | | nextCode: "", |
| | | dtmainId: "", |
| | | }; |
| | | }, |
| | | created() { |
| | | window.document.onkeypress = (e) => { |
| | | if (window.event) { |
| | | // IE |
| | | this.nextCode = e.keyCode; |
| | | } else if (e.which) { |
| | | // Netscape/Firefox/Opera |
| | | this.nextCode = e.which; |
| | | } |
| | | if (e.which === 13) { |
| | | // é®çå车äºä»¶ |
| | | if (this.code.length < 3) return; // æ«ç æªçé度å¾å¿«ï¼æå¨è¾å
¥çæ¶é´ä¸ä¼è®©codeçé¿åº¦å¤§äº2ï¼æ以è¿éä¸ä¼å¯¹æ«ç æªææ |
| | | |
| | | //console.log("æ«ç ç»æã"); |
| | | //console.log("æ¡å½¢ç ï¼", this.code); |
| | | this.parseQRCode(this.code); // è·åå°æ«ç æªè¾å
¥çå
容ï¼åå«çæä½ |
| | | this.lastCode = ""; |
| | | this.lastTime = ""; |
| | | return; |
| | | } |
| | | this.nextTime = new Date().getTime(); |
| | | if (!this.lastTime && !this.lastCode) { |
| | | this.code = ""; // æ¸
空ä¸æ¬¡çæ¡å½¢ç |
| | | this.code += e.key; |
| | | //console.log("æ«ç å¼å§---", this.code); |
| | | } |
| | | if (this.lastCode && this.lastTime && this.nextTime - this.lastTime > 500) { |
| | | // å½æ«ç åækeypressäºä»¶æ¶,é²æ¢é¦å缺失 |
| | | this.code = e.key; |
| | | //console.log("é²æ¢é¦å缺失ããã", this.code); |
| | | } else if (this.lastCode && this.lastTime) { |
| | | this.code += e.key; |
| | | //console.log("æ«ç ä¸ããã", this.code); |
| | | } |
| | | this.lastCode = this.nextCode; |
| | | this.lastTime = this.nextTime; |
| | | }; |
| | | }, |
| | | methods: { |
| | | parseQRCode(code) { |
| | | // if (code.length === 16) { |
| | | // console.log(code); |
| | | // } else if (code.length === 0) { |
| | | // console.log("请è¾å
¥æ¡ç ï¼"); |
| | | // } else { |
| | | // alert("æ¡ç ä¸åæ³ï¼" + code); |
| | | // } |
| | | this.codeValue = code; |
| | | // åéç½ç»è¯·æ± |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | |
| | | </style> |
| | | |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div style="height: 100%;width: 100%"> |
| | | <el-card class="box-card"> |
| | | <el-form size="large" :inline="true" label-width="68px" @submit.native.prevent> |
| | | <el-form-item label-width="200" label="ç®±ä½ç " :prop="barcode" style="align-content: center"> |
| | | <input v-model="barcode" |
| | | ref="inputdata" |
| | | style="height: 39px; width: 300px" |
| | | placeholder="请æ«æç®±ä½ç " |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | export default { |
| | | data(){ |
| | | return { |
| | | scannerFlag: false, |
| | | barcode: "", |
| | | }; |
| | | }, |
| | | |
| | | mounted() { |
| | | this.setFocus() |
| | | this.$refs.inputdata.addEventListener('keydown',this.handleScannerInput) |
| | | }, |
| | | beforeDestroy() { |
| | | this.$refs.inputdata.removeEventListener('keydown',this.handleScannerInput) |
| | | }, |
| | | methods: { |
| | | refresh() { |
| | | location.reload(); |
| | | }, |
| | | setFocus(){ |
| | | this.$nextTick(()=>{ |
| | | this.$refs.inputdata.focus() |
| | | }) |
| | | }, |
| | | handleScannerInput(event){ |
| | | if (this.scannerFlag){ |
| | | this.barcode = '' |
| | | this.$refs.inputdata.value = '' |
| | | this.scannerFlag = false |
| | | } |
| | | const input = event.target |
| | | const inputValue = input.value |
| | | this.barcode = inputValue |
| | | if (event.key === 'Enter'){ |
| | | this.scannerFlag = true |
| | | console.log('æ¡ç ï¼',this.barcode) |
| | | //æ«æå®æ |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | </style> |
| | | |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!--å¨Vueä¸ï¼ä½ å¯ä»¥ä½¿ç¨v-modelæ¥ç»å®å¤ä¸ªè¾å
¥å段å°åä¸ä¸ªæ°æ®æ¨¡åçä¸åå±æ§ä¸ã以ä¸æ¯ä¸ä¸ªç®åçä¾åï¼å±ç¤ºäºå¦ä½è¿ç»æ«æå¤ä¸ªå±æ§çæ¡ç ï¼--> |
| | | <template> |
| | | <div> |
| | | <input v-model="scannedCode.partNumber" @input="handleScan" placeholder="Part Number"> |
| | | <input v-model="scannedCode.serialNumber" @input="handleScan" placeholder="Serial Number"> |
| | | <input v-model="scannedCode.batchCode" @input="handleScan" placeholder="Batch Code"> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | scannedCode: { |
| | | partNumber: '', |
| | | serialNumber: '', |
| | | batchCode: '' |
| | | } |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleScan() { |
| | | // æ«æå¤çé»è¾ |
| | | console.log('Scanned code:', this.scannedCode); |
| | | // æ ¹æ®å®é
éæ±ï¼è¿éå¯ä»¥æ·»å æ«æå¤çé»è¾ï¼ä¾å¦åéæ°æ®å°æå¡å¨ç |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <!--å¨è¿ä¸ªä¾åä¸ï¼æ们æä¸ä¸ªè¾å
¥å段ç»å®å°scannedCode对象çä¸åå±æ§ä¸ãæ¯å½ç¨æ·è¾å
¥æ¶ï¼handleScanæ¹æ³ä¼è¢«è°ç¨ï¼ä½ å¯ä»¥å¨è¿ä¸ªæ¹æ³ä¸æ·»å æ«æå¤ççé»è¾ãè¿ä¸ªä¾åå设æ«æå¤çåªæ¯ç®åå°å¨æ§å¶å°è¾åºæ«æç代ç ä¿¡æ¯ï¼å¨å®é
åºç¨ä¸ï¼ä½ å¯è½éè¦è¿è¡æ´å¤æçå¤çï¼æ¯å¦éªè¯æ°æ®æåéå°æå¡å¨ã--> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <span v-for="(word, index) in words" :key="index" :style="{ color: colors[index] }">{{ word }}</span> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | words: ['ä¸æ¡£ .', 'äºæ¡£ .', 'ä¸æ¡£ .', 'åæ¡£ .'], |
| | | colors: ['#FF0000', '#00FF00', '#0000FF', '#FFFF00'] |
| | | }; |
| | | } |
| | | }; |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-form size="large" :inline="true" label-width="68px" @submit.native.prevent> |
| | | <el-form-item v-for="(item, index) in scanList" |
| | | :key="index" |
| | | label-width="200" |
| | | label="ç®±ä½ç " |
| | | :prop="item.value" |
| | | style="align-content: center" |
| | | @focus="handleFocus(index)"> |
| | | <input v-model="item.value" |
| | | ref="scanInput${index}" |
| | | style="height: 39px; width: 300px" |
| | | placeholder="请æ«æç®±ä½ç " |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | scannerFlag: false, |
| | | scanList: [ |
| | | { value: '' }, |
| | | { value: '' }, |
| | | // å¯ä»¥æ ¹æ®éè¦å¢å æ´å¤ç项 |
| | | ], |
| | | focusedIndex: 0, // å½åèç¦çinputç´¢å¼ |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.focusScanInput(this.focusedIndex); |
| | | this.setFocus() |
| | | this.$refs.scanInput$index.addEventListener('keydown',this.handleScannerInput) |
| | | }, |
| | | beforeDestroy() { |
| | | this.$refs.scanInput$index.removeEventListener('keydown',this.handleScannerInput) |
| | | }, |
| | | watch: { |
| | | // çå¬scanListçååï¼å¦æåç°ç¦ç¹ç´¢å¼è¶
åºèå´ï¼åèªå¨èç¦å°æåä¸ä¸ªè¾å
¥æ¡ |
| | | scanList: { |
| | | deep: true, |
| | | handler(newList) { |
| | | if (this.focusedIndex >= newList.length) { |
| | | this.focusedIndex = newList.length - 1; |
| | | this.$nextTick(() => { |
| | | this.focusScanInput(this.focusedIndex); |
| | | }); |
| | | } |
| | | }, |
| | | }, |
| | | }, |
| | | |
| | | methods: { |
| | | refresh() { |
| | | location.reload(); |
| | | }, |
| | | setFocus(){ |
| | | this.$nextTick(()=>{ |
| | | this.$refs.inputdata.focus() |
| | | }) |
| | | }, |
| | | handleScannerInput(event){ |
| | | if (this.scannerFlag){ |
| | | this.barcode = '' |
| | | this.$refs.inputdata.value = '' |
| | | this.scannerFlag = false |
| | | } |
| | | const input = event.target |
| | | const inputValue = input.value |
| | | this.item.value = inputValue |
| | | if (event.key === 'Enter'){ |
| | | this.scannerFlag = true |
| | | console.log('æ¡ç ï¼',this.item.value) |
| | | //æ«æå®æ |
| | | } |
| | | }, |
| | | |
| | | handleFocus(index) { |
| | | this.focusedIndex = index; |
| | | }, |
| | | focusScanInput(index) { |
| | | this.$refs[`scanInput${index}`][0].focus(); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <!--å¨è¿ä¸ªä¾åä¸ï¼æ们使ç¨äºä¸ä¸ªæ°ç»scanListæ¥å¨æçæå¤ä¸ªè¾å
¥æ¡ãéè¿handleFocusæ¹æ³æ´æ°å½åèç¦çè¾å
¥æ¡ç´¢å¼ï¼ |
| | | 并éè¿watchæ¥çå¬scanListçååï¼ä»¥ç¡®ä¿å¦ææ°æ·»å çè¾å
¥æ¡è¶
åºäºåæçç´¢å¼èå´ï¼ |
| | | æ们å¯ä»¥èªå¨èç¦å°æåä¸ä¸ªè¾å
¥æ¡ä¸ãfocusScanInputæ¹æ³ç¨äºè®¾ç½®çå®DOMçç¦ç¹ã--> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div style="height: 100%;width: 100%"> |
| | | <el-card class="box-card"> |
| | | <el-form size="large" :inline="true" label-width="68px" @submit.native.prevent> |
| | | <el-form-item label-width="200" label="ç®±ä½ç " :prop="barcode1" style="align-content: center"> |
| | | <input v-model="barcode1" |
| | | ref="inputdata1" |
| | | style="height: 39px; width: 300px" |
| | | placeholder="请æ«æç®±ä½ç " |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label-width="200" label="å®ç " :prop="barcode2" style="align-content: center"> |
| | | <input v-model="barcode2" |
| | | ref="inputdata2" |
| | | style="height: 39px; width: 300px" |
| | | placeholder="请æ«æå®ç " |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | export default { |
| | | data(){ |
| | | return { |
| | | scannerFlag: false, |
| | | barcode1: "", |
| | | barcode2: "", |
| | | }; |
| | | }, |
| | | |
| | | mounted() { |
| | | this.setFocus() |
| | | this.$refs.inputdata1.addEventListener('keydown',this.handleScannerInput1) |
| | | this.$refs.inputdata2.addEventListener('keydown',this.handleScannerInput2) |
| | | }, |
| | | beforeDestroy() { |
| | | this.$refs.inputdata1.removeEventListener('keydown',this.handleScannerInput1) |
| | | this.$refs.inputdata2.removeEventListener('keydown',this.handleScannerInput2) |
| | | }, |
| | | methods: { |
| | | refresh() { |
| | | location.reload(); |
| | | }, |
| | | setFocus(){ |
| | | this.$nextTick(()=>{ |
| | | this.$refs.inputdata1.focus() |
| | | }) |
| | | }, |
| | | handleScannerInput1(event){ |
| | | if (this.scannerFlag){ |
| | | this.barcode1 = '' |
| | | this.$refs.inputdata1.value = '' |
| | | this.scannerFlag = false |
| | | } |
| | | const input = event.target |
| | | const inputValue = input.value |
| | | this.barcode1 = inputValue |
| | | if (event.key === 'Enter'){ |
| | | this.scannerFlag = true |
| | | console.log('æ¡ç 1ï¼',this.barcode1) |
| | | this.$refs.inputdata2.focus(); |
| | | //æ«æå®æ |
| | | } |
| | | }, |
| | | handleScannerInput2(event){ |
| | | if (this.scannerFlag){ |
| | | this.barcode2 = '' |
| | | this.$refs.inputdata2.value = '' |
| | | this.scannerFlag = false |
| | | } |
| | | const input = event.target |
| | | const inputValue = input.value |
| | | this.barcode2 = inputValue |
| | | if (event.key === 'Enter'){ |
| | | this.scannerFlag = true |
| | | console.log('æ¡ç 2ï¼',this.barcode2) |
| | | this.$refs.inputdata1.focus(); |
| | | //æ«æå®æ |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | </style> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | <span>{{queryParams.scanObject2}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ç»æ"> |
| | | <span style="color: #FFFFFF;" :style="{ backgroundColor: queryParams.tileColor }">{{queryParams.tileColor}}</span> |
| | | <span style="color: #FFFFFF;" :style="{ backgroundColor: queryParams.tileColor }">{{queryParams.words}}</span> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <el-divider></el-divider> |
| | |
| | | import VueQr from 'vue-qr' |
| | | import { listTileMatchRules, getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules } from "@/api/main/bs/tileMatchRules/tileMatchRules"; |
| | | import {listStationConf,getIp} from "@/api/main/sc/stationConf"; |
| | | import {setBarcode1} from "@/api/main/da/opcuaconfig/opcuaconfig"; |
| | | export default { |
| | | name: "index", |
| | | dicts: ['colour_hex','productseries','axisname','neckname','tilename'], |
| | |
| | | neckParameterPosition: null, |
| | | axisValue: null, |
| | | neckValue: null, |
| | | words:"", |
| | | tileColor: null, |
| | | createUser: null, |
| | | updateUser: null, |
| | |
| | | } |
| | | const input = event.target |
| | | const inputValue = input.value |
| | | this.from.scanObject2 = inputValue |
| | | //this.from.scanObject2 = inputValue |
| | | if (event.key === 'Enter'){ |
| | | this.scannerFlag = true |
| | | console.log('æ¡ç ï¼',this.from.scanObject2) |
| | | //æ«æå®æ |
| | | this.from.scanObject2 = inputValue |
| | | //console.log('æ¡ç ï¼',this.from.scanObject2,this.locationCode) |
| | | if (typeof this.from.scanObject2 !== 'undefined'&& typeof this.locationCode !== 'undefined' ) { |
| | | console.log('æ¡ç ï¼',this.from.scanObject2,this.locationCode) |
| | | setBarcode1({barcode:this.from.scanObject2,locationCode:this.locationCode}).then(res => { |
| | | if (res.data===500){ |
| | | this.$message({ |
| | | message:res.msg, |
| | | type:'warning' |
| | | }) |
| | | }else { |
| | | this.$message({ |
| | | message:'æä½æå', |
| | | type:'success' |
| | | }) |
| | | console.log('è¿åï¼',res) |
| | | this.queryParams.productSeries=res.sfcCode |
| | | this.queryParams.scanObject1=res.paramValue |
| | | this.queryParams.scanObject2=this.from.scanObject2 |
| | | this.queryParams.words="æ«ç æå"; |
| | | this.queryParams.tileColor='#00FF00'; |
| | | |
| | | } |
| | | }) |
| | | |
| | | } |
| | | //setBarcode({barcode:'1111',locationCode:'555555'}) |
| | | // //æ«æå®æ |
| | | // if(this.form.scanObject2 !== null && this.form.scanObject2 !== undefined){ |
| | | // console.log('æ¡ç ï¼',this.from.scanObject2,this.locationCode) |
| | | // //setBarcode(this.form.scanObject2,this.locationCode) |
| | | // } |
| | | } |
| | | }, |
| | | |
| | |
| | | <span>{{queryParams.weight}}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="é
ç¦é¢è²"> |
| | | <span style="color: #FFFFFF;" :style="{ backgroundColor: queryParams.tileColor }">{{queryParams.tileColor}}</span> |
| | | <!-- <span style="color: #FFFFFF;" :style="{ backgroundColor: queryParams.tileColor }">{{queryParams.tileColor}}</span>--> |
| | | <span v-for="(word, index) in queryParams.words" :key="index" :style="{ backgroundColor: queryParams.colors[index],fontSize: '30px',}">{{ word }}</span> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <el-divider></el-divider> |
| | |
| | | pageSize: 10, |
| | | productSeries: null, |
| | | //scanObject1: null, |
| | | scanObject1: 'P0SQ0-01FZ01-1000;T231224116;DBBBBA', |
| | | scanObject2: 'P0SQ0-041000-1002;T2312020675;DAABBA;S500003', |
| | | scanObject1: 'ONYL01FZ0120003023123;1206B0026;D2212BA', |
| | | scanObject2: 'P0NYK0410001000;T231107031;D2222232;S500003', |
| | | axisName: null, |
| | | neckName: null, |
| | | tileName: null, |
| | |
| | | neckParameterPosition: null, |
| | | axisValue: null, |
| | | neckValue: null, |
| | | tileColor: null, |
| | | tileColor: "", |
| | | words: ['ä¸æ¡£ .', 'äºæ¡£ .', 'ä¸æ¡£ .', 'åæ¡£ .'], |
| | | colors: ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF'], |
| | | createUser: null, |
| | | updateUser: null, |
| | | state: null, |
| | |
| | | this.clear(); |
| | | |
| | | if(this.from.scanObject1 !== null && this.from.scanObject2 !== null |
| | | && this.from.axisName !== null && this.from.axisName !== "" |
| | | && this.from.neckName !== null && this.from.neckName !== "" |
| | | && this.from.tileName !== null && this.from.tileName !== "" |
| | | // && this.from.axisName !== null && this.from.axisName !== "" |
| | | // && this.from.neckName !== null && this.from.neckName !== "" |
| | | // && this.from.tileName !== null && this.from.tileName !== "" |
| | | && this.from.productSeries !== null && this.from.productSeries !== "") |
| | | { |
| | | this.axisValueextracted(); |
| | |
| | | } |
| | | console.log(queryParams) |
| | | listTileMatchRules(queryParams).then(response => { |
| | | this.queryParams.tileColor = response.rows[0].tileColor; |
| | | this.queryParams.words= ['------', '------', '------', '------'] |
| | | this.queryParams.colors= ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF'] |
| | | for (var i=0;i<response.rows.length;i++){ |
| | | this.queryParams.colors[i]=response.rows[i].tileColor; |
| | | this.queryParams.words[i]=response.rows[i].tileName; |
| | | } |
| | | console.log('é¢è²ï¼',response) |
| | | }); |
| | | }, |
| | | clear(){ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-card class="box-card"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="产åSNå·" prop="sfcCode"> |
| | | <el-input |
| | | v-model="queryParams.sfcCode" |
| | | placeholder="请è¾å
¥äº§åSNå·" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æçå·" prop="palletNo"> |
| | | <el-input |
| | | v-model="queryParams.palletNo" |
| | | placeholder="请è¾å
¥æçå·" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æ²è½´ç " prop="crankshaftNo"> |
| | | <el-input |
| | | v-model="queryParams.crankshaftNo" |
| | | placeholder="请è¾å
¥æ²è½´ç " |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="state"> |
| | | <el-input |
| | | v-model="queryParams.state" |
| | | placeholder="请è¾å
¥ç¶æ" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="è¿æç " prop="connectingrodNo"> |
| | | <el-input |
| | | v-model="queryParams.connectingrodNo" |
| | | placeholder="请è¾å
¥è¿æç " |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item style="float: right"> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | |
| | | <el-card style="margin-top: 10px" class="box-card"> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['da:tileMatchMiddleware:add']" |
| | | >æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['da:tileMatchMiddleware:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['da:tileMatchMiddleware:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['da:tileMatchMiddleware:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table border v-loading="loading" :data="tileMatchMiddlewareList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="ID" align="center" prop="id" /> |
| | | <el-table-column label="产åSNå·" align="center" prop="sfcCode"> |
| | | </el-table-column> |
| | | <el-table-column label="æçå·" align="center" prop="palletNo"> |
| | | </el-table-column> |
| | | <el-table-column label="æ²è½´ç " align="center" prop="crankshaftNo"> |
| | | </el-table-column> |
| | | <el-table-column label="ç¶æ" align="center" prop="state"> |
| | | </el-table-column> |
| | | <el-table-column label="å¤æ³¨" align="center" prop="remarks"> |
| | | </el-table-column> |
| | | <el-table-column label="è¿æç " align="center" prop="connectingrodNo"> |
| | | </el-table-column> |
| | | <el-table-column label="æ°ç¼¸ç¼å·" align="center" prop="cylinder"> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" width="200" label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="success" |
| | | plain |
| | | style="width: 72px" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['da:tileMatchMiddleware:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="danger" |
| | | plain |
| | | style="width: 72px" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['da:tileMatchMiddleware:remove']" |
| | | >å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-card> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹æ´»å¡è¿æé
ç¦ä¸é´å¯¹è¯æ¡ --> |
| | | <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body> |
| | | <span slot="title"> |
| | | <i class="el-icon-s-order"></i> |
| | | {{titleName}} |
| | | </span> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="产åSNå·" prop="sfcCode"> |
| | | <el-input v-model="form.sfcCode" placeholder="请è¾å
¥äº§åSNå·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æçå·" prop="palletNo"> |
| | | <el-input v-model="form.palletNo" placeholder="请è¾å
¥æçå·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ²è½´ç " prop="crankshaftNo"> |
| | | <el-input v-model="form.crankshaftNo" placeholder="请è¾å
¥æ²è½´ç " /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="state"> |
| | | <el-input v-model="form.state" placeholder="请è¾å
¥ç¶æ" /> |
| | | </el-form-item> |
| | | <el-form-item label="å¤æ³¨" prop="remarks"> |
| | | <el-input v-model="form.remarks" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | <el-form-item label="è¿æç " prop="connectingrodNo"> |
| | | <el-input v-model="form.connectingrodNo" placeholder="请è¾å
¥è¿æç " /> |
| | | </el-form-item> |
| | | <el-form-item label="æ°ç¼¸ç¼å·" prop="cylinder"> |
| | | <el-input v-model="form.cylinder" placeholder="请è¾å
¥æ°ç¼¸ç¼å·" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listTileMatchMiddleware, getTileMatchMiddleware, delTileMatchMiddleware, addTileMatchMiddleware, updateTileMatchMiddleware } from "@/api/main/da/tileMatchMiddleware/tileMatchMiddleware"; |
| | | |
| | | export default { |
| | | name: "TileMatchMiddleware", |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | | loading: true, |
| | | titleName: "", |
| | | // éä¸æ°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // æ´»å¡è¿æé
ç¦ä¸é´è¡¨æ ¼æ°æ® |
| | | tileMatchMiddlewareList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | sfcCode: null, |
| | | palletNo: null, |
| | | crankshaftNo: null, |
| | | state: null, |
| | | remarks: null, |
| | | connectingrodNo: null, |
| | | cylinder: null |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // 表åæ ¡éª |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: "IDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢æ´»å¡è¿æé
ç¦ä¸é´å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listTileMatchMiddleware(this.queryParams).then(response => { |
| | | this.tileMatchMiddlewareList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | id: null, |
| | | sfcCode: null, |
| | | palletNo: null, |
| | | crankshaftNo: null, |
| | | state: null, |
| | | remarks: null, |
| | | connectingrodNo: null, |
| | | cylinder: null |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡éä¸æ°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.id) |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.titleName = "æ·»å æ´»å¡è¿æé
ç¦ä¸é´"; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | const id = row.id || this.ids |
| | | getTileMatchMiddleware(id).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.titleName = "ä¿®æ¹æ´»å¡è¿æé
ç¦ä¸é´"; |
| | | }); |
| | | }, |
| | | /** æ交æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.id != null) { |
| | | updateTileMatchMiddleware(this.form).then(response => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addTileMatchMiddleware(this.form).then(response => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤æ´»å¡è¿æé
ç¦ä¸é´ç¼å·ä¸º"' + ids + '"çæ°æ®é¡¹ï¼').then(function() { |
| | | return delTileMatchMiddleware(ids); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å é¤æå"); |
| | | }).catch(() => {}); |
| | | }, |
| | | /** 导åºæé®æä½ */ |
| | | handleExport() { |
| | | this.download('da/tileMatchMiddleware/export', { |
| | | ...this.queryParams |
| | | }, `tileMatchMiddleware_${new Date().getTime()}.xlsx`) |
| | | } |
| | | } |
| | | }; |
| | | </script> |