commit
This commit is contained in:
		| @@ -1,7 +1,11 @@ | ||||
| spring: | ||||
|   datasource: | ||||
|       #MySQL | ||||
|       driver-class-name: com.mysql.cj.jdbc.Driver | ||||
|       #MySQL | ||||
|       #url: jdbc:mysql://10.0.1.249:3306/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true | ||||
|       #username: cigs4 | ||||
|       #password: 1qazxsw2 | ||||
|  | ||||
|       url: jdbc:mysql://mysql.picaiba.com:30307/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true | ||||
|       username: root | ||||
|       password: 1qaz@WSX3edc$RFV | ||||
| @@ -61,14 +65,14 @@ dynamic: | ||||
| #      username: root | ||||
| #      password: 1qaz@WSX3edc$RFV | ||||
|     ## camline系统 | ||||
|     camline: | ||||
|       driver-class-name: com.mysql.cj.jdbc.Driver | ||||
|       url: jdbc:mysql://mysql.picaiba.com:30307/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true | ||||
|       username: root | ||||
|       password: 1qaz@WSX3edc$RFV | ||||
| # | ||||
| #    camline: | ||||
| #      driver-class-name: com.mysql.cj.jdbc.Driver | ||||
| #      url: jdbc:mysql://10.0.1.23:3306/synapse?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true | ||||
| #      username: offline_data | ||||
| #      password: tpvmfab4 | ||||
| #      url: jdbc:mysql://mysql.picaiba.com:30307/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true | ||||
| #      username: root | ||||
| #      password: 1qaz@WSX3edc$RFV | ||||
| # | ||||
|     camline: | ||||
|       driver-class-name: com.mysql.cj.jdbc.Driver | ||||
|       url: jdbc:mysql://10.0.1.23:3306/synapse?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true | ||||
|       username: offline_data | ||||
|       password: tpvmfab4 | ||||
| @@ -33,9 +33,10 @@ spring: | ||||
|       enabled: true | ||||
|   redis: | ||||
|     database: 6 | ||||
|     host: 192.168.0.135 | ||||
|     port: 6380 | ||||
|     password: '@WSXcde3'   # 密码(默认为空) | ||||
|     host: 10.0.1.249 | ||||
|     #host: 127.0.0.1 | ||||
|     port: 6379 | ||||
|     password: ''   # 密码(默认为空) | ||||
|     timeout: 6000ms  # 连接超时时长(毫秒) | ||||
|     jedis: | ||||
|       pool: | ||||
|   | ||||
| @@ -16,7 +16,7 @@ | ||||
|  | ||||
|     <property name="logging.eqlog" value="/usr/local/logger/EQCommunicationLog" /> | ||||
|     <property name="logging.packing" value="/usr/local/logger/Packing" /> | ||||
|  | ||||
|     <property name="logging.pathwork" value="/usr/local/logger/Working" /> | ||||
|  | ||||
|  | ||||
|     <!--0. 日志格式和颜色渲染 --> | ||||
| @@ -392,6 +392,12 @@ | ||||
|  | ||||
|     <!-- name就是包名,这个包下的 所有logger 输出就以下配置(这里的logger只会输出代码里 你指定打印的log ) --> | ||||
|  | ||||
| <!--    <logger name="com.cnbm.pathwork" additivity="false">--> | ||||
| <!--        <appender-ref ref="WORKING_DEBUG_FILE" />--> | ||||
| <!--        <appender-ref ref="WORKING_INFO_FILE" />--> | ||||
| <!--        <appender-ref ref="WORKING_WARN_FILE" />--> | ||||
| <!--        <appender-ref ref="WORKING_ERROR_FILE" />--> | ||||
| <!--    </logger>--> | ||||
|     <logger name="com.cnbm.dispatch" additivity="false"> | ||||
|         <appender-ref ref="EQ_COMM_LOG_DEBUG_FILE" /> | ||||
|         <appender-ref ref="EQ_COMM_LOG_INFO_FILE" /> | ||||
|   | ||||
| @@ -8,6 +8,7 @@ import com.cnbm.dispatch.enums.kuka.step2.Step2Plc2MesVar; | ||||
| import com.cnbm.dispatch.enums.kuka.step3.Step3Mes2PlcVar; | ||||
| import com.cnbm.dispatch.enums.kuka.step3.Step3Plc2MesVar; | ||||
| import com.cnbm.packing.dto.CamlineExtendArgDTO; | ||||
| import com.cnbm.packing.dto.CamlineSubIdDTO; | ||||
| import com.cnbm.packing.entity.WoPackagingBox; | ||||
| import com.cnbm.packing.entity.WoPackagingBoxSubstrate; | ||||
| import com.cnbm.packing.entity.WoPowerLevel; | ||||
| @@ -153,12 +154,24 @@ public class KukaJoinThread implements ApplicationRunner { | ||||
|         return res; | ||||
|     } | ||||
|  | ||||
|     public String removeKG(String str){ | ||||
|         return str.substring(0,17); | ||||
|     } | ||||
|  | ||||
|     public static void main(String[] args) { | ||||
|         String str = "30110012302210707   "; | ||||
|         String substring = str.substring(0,17); | ||||
|         System.out.println(substring); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void run(ApplicationArguments args) throws Exception { | ||||
|  | ||||
|         kukaStep1.scheduleAtFixedRate(new Runnable() { | ||||
|             @Override | ||||
|             public void run() { | ||||
|                 try { | ||||
|  | ||||
|                     //调度开始 | ||||
| //                logger.info(""); | ||||
| //                logger.info("=================  现在开始执行 过程一 任务   =================="); | ||||
| @@ -170,7 +183,8 @@ public class KukaJoinThread implements ApplicationRunner { | ||||
|                     //一. 从plc 中获取 subId 和 lineNum | ||||
|                     String subId = (String) read(S7Client.S7_KUKA,Step1Plc2MesVar.SubIdToMes); | ||||
|                     Integer lineNum = (Integer) read(S7Client.S7_KUKA,Step1Plc2MesVar.LineNum); | ||||
|  | ||||
|                     //把基板ID字符串的空格去掉,因为plc中设置的20位,但实际基板ID就是17位,因为带空格去数据库查询 有问题的。 | ||||
|                     subId = removeKG(subId); | ||||
|  | ||||
|                     //二. MES 业务 | ||||
|                     //===============           MES 业务 开始         ================= | ||||
| @@ -185,7 +199,8 @@ public class KukaJoinThread implements ApplicationRunner { | ||||
|                     write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Isc,argByPMPP.getLableIsc()); | ||||
|                     write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Vmpp,argByPMPP.getLableVmpp()); | ||||
|                     write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Impp,argByPMPP.getLableImpp()); | ||||
|                 logger.info("采集到 基板ID: "+subId+", 线边号:"+lineNum+",dLable_Pnom: "+argByPMPP.getPowerClass() +",dLable_Voc: "+argByPMPP.getLableVoc()+",dLable_Isc: "+argByPMPP.getLableIsc()+",dLable_Vmpp: "+argByPMPP.getLableVmpp()+",dLable_Impp: "+argByPMPP.getLableImpp()); | ||||
|                     logger.info("采集到 基板ID: "+subId+", 线边号:"+lineNum+",从camline 获取到实际pmpp"+pmppBySubId+",计算后 补偿功率:"+actualPMPP+",dLable_Pnom: "+argByPMPP.getPowerClass() +",dLable_Voc: "+argByPMPP.getLableVoc()+",dLable_Isc: "+argByPMPP.getLableIsc()+",dLable_Vmpp: "+argByPMPP.getLableVmpp()+",dLable_Impp: "+argByPMPP.getLableImpp()); | ||||
|  | ||||
|  | ||||
|  | ||||
|                     //4. 把基板录到数据库 | ||||
| @@ -243,6 +258,9 @@ public class KukaJoinThread implements ApplicationRunner { | ||||
|                         logger.info("失败"+" --- "+"MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败"); | ||||
|                     } | ||||
|                     write(S7Client.S7_KUKA,Step1Mes2PlcVar.SubArrivedFinish,false); | ||||
|                 }catch (Throwable e){ | ||||
|                     logger.info("Event1 :"+e.getMessage()); | ||||
|                 } | ||||
|             } | ||||
|         },1,1, TimeUnit.SECONDS); | ||||
|  | ||||
| @@ -250,6 +268,8 @@ public class KukaJoinThread implements ApplicationRunner { | ||||
|         kukaStep2.scheduleAtFixedRate(new Runnable() { | ||||
|             @Override | ||||
|             public void run() { | ||||
|                 try { | ||||
|  | ||||
|                     //调度开始 | ||||
|  | ||||
|                     Integer shelfIsFull = waitingForTarget(Step2Plc2MesVar.ShelfIsFull, true); | ||||
| @@ -259,21 +279,38 @@ public class KukaJoinThread implements ApplicationRunner { | ||||
|  | ||||
|                     //一. 从plc 中获取 subIdList 和 lineNum | ||||
|                     String[] subIdList = (String[])read(S7Client.S7_KUKA,Step2Plc2MesVar.SubIdList); | ||||
| //                Integer lineNum = (Integer) read(S7Client.S7_KUKA,Step2Plc2MesVar.LineNum); | ||||
|                 logger.info("获取到基板列表:"+ Arrays.toString(subIdList)); | ||||
|                     Integer listSize = (Integer)read(S7Client.S7_KUKA,Step2Plc2MesVar.PackageNumberSet); | ||||
|  | ||||
|                     //二. MES 业务 | ||||
|                     //===============           MES 业务 开始         ================= | ||||
|                     //1.MES 生成BoxId | ||||
|                     if(subIdList.length<=0){ | ||||
|                         logger.info("失败"+" --- "+"从plc里面获取到的基板列表 为空"); | ||||
|                         throw new Exception("kuka机械手 取到了空箱"); | ||||
|                     } | ||||
|                     //真实的基板ID 就是17位的,plc读取过来,有空格,要把后面3位空格去掉就行了。 | ||||
|                     for(int i=0;i<subIdList.length;i++){ | ||||
|                         subIdList[i] = removeKG(subIdList[i]); | ||||
|                     } | ||||
|                     logger.info("获取到基板列表:"+ Arrays.toString(subIdList)+",基板数量:"+listSize); | ||||
|  | ||||
|                     WoPackagingBoxSubstrate bySubId = substrateServiceBiz.getBySubId(subIdList[0]); | ||||
|                     //如果我们系统中找不到这块基板那么就去camline里面找 | ||||
|                     if(bySubId == null){ | ||||
|                         //todo | ||||
|                         CamlineSubIdDTO subIdByCamline = service.getSubIdByCamline(subIdList[0]); | ||||
|                         bySubId = new WoPackagingBoxSubstrate(); | ||||
|                         bySubId.setPowerLevel(subIdByCamline.getPowerLevel()); | ||||
|                         bySubId.setSapMaterial(subIdByCamline.getSapMaterial()); | ||||
|                         bySubId.setLineBody(2); | ||||
|                     } | ||||
|  | ||||
|  | ||||
|                     String boxId = getBoxId(bySubId.getSapMaterial()); | ||||
|                     logger.info("mes 生成的boxId :"+ boxId); | ||||
|                     //2. 依次update 基板表,把boxId 赋予这些基板 | ||||
|                 for(int i=0;i<subIdList.length;i++){ | ||||
|                     substrateServiceBiz.updatePackagingBoxIdByWoSubstrateId(boxId,subIdList[i]); | ||||
|                     for(int i=0;i<listSize;i++){ | ||||
|                         substrateServiceBiz.updatePackagingBoxIdAndSlotByWoSubstrateId(boxId,i,subIdList[i]); | ||||
|                     } | ||||
|                     //3.去camline数据库 查询此基板ID 对应的订单 | ||||
|                     String orderNameBySubId = service.getOrderNameBySubId(subIdList[0]); | ||||
| @@ -303,6 +340,9 @@ public class KukaJoinThread implements ApplicationRunner { | ||||
|                         logger.info("失败"+" --- "+"步骤1.  MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败"); | ||||
|                     } | ||||
|                     write(S7Client.S7_KUKA,Step2Mes2PlcVar.ShelfIsFullFinish,false); | ||||
|                 }catch (Throwable e){ | ||||
|                     logger.info(e.getMessage()); | ||||
|                 } | ||||
|             } | ||||
|         },1,1, TimeUnit.SECONDS); | ||||
|  | ||||
| @@ -310,6 +350,8 @@ public class KukaJoinThread implements ApplicationRunner { | ||||
|         kukaStep3.scheduleAtFixedRate(new Runnable() { | ||||
|             @Override | ||||
|             public void run() { | ||||
|                 try { | ||||
|  | ||||
|                     //调度开始 | ||||
|                     Integer shelfIsFull = waitingForTarget(Step3Plc2MesVar.ShelfIsFullArrived, true); | ||||
|                     if(shelfIsFull != 1){ | ||||
| @@ -337,7 +379,9 @@ public class KukaJoinThread implements ApplicationRunner { | ||||
|                         logger.info("失败"+" --- "+"步骤1.  MES监听 Step3Plc2MesVar.ShelfIsFullArrived 是否 等于 1 失败"); | ||||
|                     } | ||||
|                     write(S7Client.S7_KUKA,Step3Mes2PlcVar.ShelfIsFullArrivedFinish,false); | ||||
|  | ||||
|                 }catch (Throwable e){ | ||||
|                     logger.info(e.getMessage()); | ||||
|                 } | ||||
|  | ||||
|             } | ||||
|         },1,1, TimeUnit.SECONDS); | ||||
|   | ||||
| @@ -14,7 +14,9 @@ public enum Step2Plc2MesVar { | ||||
|  | ||||
|     ShelfIsFull("ShelfIsFull", PlcVar.BOOL,1, DaveArea.DB,2000,48,0), | ||||
|     SubIdList("SubIdList",PlcVar.STRING_Array,30,DaveArea.DB,2000,50,0,20), | ||||
|     LineNum("LineNum", PlcVar.BOOL,1, DaveArea.DB,2000,710,0), | ||||
|     LineNum("LineNum", PlcVar.UINT,1, DaveArea.DB,2000,710,0), | ||||
|     PackageNumberSet("PackageNumberSet", PlcVar.UINT,1, DaveArea.DB,2000,766,0), | ||||
|  | ||||
|     ; | ||||
|  | ||||
|     private String name; | ||||
|   | ||||
| @@ -6,7 +6,10 @@ import com.cnbm.dispatch.enums.kuka.step2.Step2Mes2PlcVar; | ||||
| import com.cnbm.dispatch.enums.kuka.step2.Step2Plc2MesVar; | ||||
| import com.cnbm.dispatch.enums.kuka.step3.Step3Mes2PlcVar; | ||||
| import com.cnbm.dispatch.enums.kuka.step3.Step3Plc2MesVar; | ||||
| import com.cnbm.packing.dto.CamlineSubIdDTO; | ||||
| import com.cnbm.packing.entity.WoPackagingBoxSubstrate; | ||||
| import com.cnbm.packing.service.DynamicDataSourceService; | ||||
| import com.cnbm.packing.service.WoPackagingBoxSubstrateServiceBiz; | ||||
| import com.cnbm.s7.entity.R; | ||||
| import com.cnbm.s7.s7connector.enmuc.S7Client; | ||||
| import com.cnbm.s7.s7connector.type.PlcVar; | ||||
| @@ -23,6 +26,7 @@ import springfox.documentation.annotations.ApiIgnore; | ||||
| import java.io.UnsupportedEncodingException; | ||||
| import java.math.BigDecimal; | ||||
| import java.text.ParseException; | ||||
| import java.util.Arrays; | ||||
| import java.util.Map; | ||||
|  | ||||
|  | ||||
| @@ -39,6 +43,8 @@ public class TestController { | ||||
|     private static final Logger logger = LoggerFactory.getLogger(TestController.class); | ||||
|     @Autowired | ||||
|     DynamicDataSourceService service; | ||||
|     @Autowired | ||||
|     WoPackagingBoxSubstrateServiceBiz substrateServiceBiz; | ||||
|     private Object read(S7Client s7Client,Step1Plc2MesVar var) throws UnsupportedEncodingException, ParseException { | ||||
|         try { | ||||
|             return s7Client.read(var.getArea(), var.getAreaNumber(), var.getByteOffset(), var.getBitOffset(), var.getLength(), var.getStrSize(), var.getType()); | ||||
| @@ -95,7 +101,12 @@ public class TestController { | ||||
|             return null; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @PostMapping("/forString") | ||||
|     public R forString() throws UnsupportedEncodingException, ParseException { | ||||
|         String[] s = (String[])read(S7Client.S7_KUKA,Step2Plc2MesVar.SubIdList); | ||||
|         System.out.println(Step2Plc2MesVar.SubIdList.getName()+" : "+Arrays.toString(s)); | ||||
|         return R.ok(); | ||||
|     } | ||||
|     @PostMapping("/testReadAll") | ||||
|     public R testReadAll() throws UnsupportedEncodingException, ParseException { | ||||
|         for(Step1Plc2MesVar actual:Step1Plc2MesVar.values()){ | ||||
| @@ -139,17 +150,32 @@ public class TestController { | ||||
|         BigDecimal vmpp = new BigDecimal(46.799); | ||||
|         BigDecimal impp = new BigDecimal(3.0799); | ||||
|         write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Pnom,new Integer(1)); | ||||
|         System.out.println(Step1Mes2PlcVar.dLable_Pnom.getName()+" : "+1); | ||||
|  | ||||
|         write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Voc,voc); | ||||
|         System.out.println(Step1Mes2PlcVar.dLable_Voc.getName()+" : "+voc.toPlainString()); | ||||
|  | ||||
|         write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Isc,isc); | ||||
|         System.out.println(Step1Mes2PlcVar.dLable_Isc.getName()+" : "+isc.toPlainString()); | ||||
|  | ||||
|         write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Vmpp,vmpp); | ||||
|         System.out.println(Step1Mes2PlcVar.dLable_Vmpp.getName()+" : "+vmpp.toPlainString()); | ||||
|  | ||||
|         write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Impp,impp); | ||||
|         System.out.println(Step1Mes2PlcVar.dLable_Impp.getName()+" : "+impp.toPlainString()); | ||||
|  | ||||
|  | ||||
|         write(S7Client.S7_KUKA,Step2Mes2PlcVar.BoxId,"12345678901111111111"); | ||||
|         System.out.println(Step2Mes2PlcVar.BoxId.getName()+" : "+"12345678901111111111"); | ||||
|  | ||||
|         write(S7Client.S7_KUKA,Step1Mes2PlcVar.SubArrivedFinish,true); | ||||
|         System.out.println(Step1Mes2PlcVar.SubArrivedFinish.getName()+" : "+"true"); | ||||
|  | ||||
|         write(S7Client.S7_KUKA,Step2Mes2PlcVar.ShelfIsFullFinish,false); | ||||
|         System.out.println(Step2Mes2PlcVar.ShelfIsFullFinish.getName()+" : "+"false"); | ||||
|  | ||||
|         write(S7Client.S7_KUKA,Step3Mes2PlcVar.ShelfIsFullArrivedFinish,true); | ||||
|         System.out.println(Step3Mes2PlcVar.ShelfIsFullArrivedFinish.getName()+" : "+"true"); | ||||
|  | ||||
|  | ||||
|         return R.ok(); | ||||
| @@ -158,6 +184,23 @@ public class TestController { | ||||
|     public R testlogger() { | ||||
|         logger.info("test logger"); | ||||
|         System.out.println("test logger"); | ||||
| //        CamlineSubIdDTO subIdByCamline = service.getSubIdByCamline("30110012302220591"); | ||||
| //        CamlineSubIdDTO subIdByCamline2 = service.getSubIdByCamline("30110012302220591   "); | ||||
| //        System.out.println("subIdByCamline: "+subIdByCamline.toString()); | ||||
| //        System.out.println("subIdByCamline2: "+subIdByCamline2.toString()); | ||||
|  | ||||
| //        WoPackagingBoxSubstrate bySubId = substrateServiceBiz.getBySubId("30110012302220591   "); | ||||
| //        System.out.println("bySubId: "+bySubId.toString()); | ||||
|  | ||||
|         WoPackagingBoxSubstrate bySubId = substrateServiceBiz.getBySubId("30110012302210707   "); | ||||
|         if(bySubId == null){ | ||||
|             //todo | ||||
|             CamlineSubIdDTO subIdByCamline = service.getSubIdByCamline("30110012302220591   "); | ||||
|             bySubId = new WoPackagingBoxSubstrate(); | ||||
|             bySubId.setPowerLevel(subIdByCamline.getPowerLevel()); | ||||
|             bySubId.setSapMaterial(subIdByCamline.getSapMaterial()); | ||||
|             System.out.println("bySubId2 : "+bySubId.toString()); | ||||
|         } | ||||
|         return R.ok(); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -0,0 +1,30 @@ | ||||
| package com.cnbm.packing.dto; | ||||
|  | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.io.Serializable; | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * 打印标签模板表 | ||||
|  * | ||||
|  * @author codeGenerator | ||||
|  * @since  2023-02-20 | ||||
|  */ | ||||
| @Data | ||||
| @ApiModel(value = "camline 查询对象") | ||||
| public class CamlineSubIdDTO implements Serializable { | ||||
|  | ||||
| 	private static final long serialVersionUID = 1L; | ||||
|  | ||||
|  | ||||
| 	private String powerLevel; | ||||
|  | ||||
| 	private String sapMaterial; | ||||
|  | ||||
|  | ||||
|  | ||||
| } | ||||
| @@ -1,6 +1,7 @@ | ||||
| package com.cnbm.packing.mapper; | ||||
|  | ||||
| import com.cnbm.packing.dto.CamlineExtendArgDTO; | ||||
| import com.cnbm.packing.dto.CamlineSubIdDTO; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| import org.apache.ibatis.annotations.Param; | ||||
|  | ||||
| @@ -26,4 +27,6 @@ public interface CamlineMapper { | ||||
|     CamlineExtendArgDTO getExtendArgFromCamline(@Param("subId") String subId); | ||||
|  | ||||
|     Integer getTodayBoxNum(); | ||||
|  | ||||
|     CamlineSubIdDTO getSubIdByCamline(@Param("subId") String subId); | ||||
| } | ||||
| @@ -15,5 +15,6 @@ import org.apache.ibatis.annotations.Mapper; | ||||
| public interface WoPackagingBoxSubstrateMapper extends BaseDao<WoPackagingBoxSubstrate> { | ||||
|     WoPackagingBoxSubstrate getOneByWoSubstrateId(@Param("woSubstrateId") String woSubstrateId); | ||||
|  | ||||
|     int updatePackagingBoxIdByWoSubstrateId(@Param("packagingBoxId") String packagingBoxId, @Param("woSubstrateId") String woSubstrateId); | ||||
|  | ||||
|     int updatePackagingBoxIdAndSlotByWoSubstrateId(@Param("packagingBoxId") String packagingBoxId, @Param("slot") Integer slot, @Param("woSubstrateId") String woSubstrateId); | ||||
| } | ||||
| @@ -2,6 +2,7 @@ package com.cnbm.packing.service; | ||||
|  | ||||
| import com.cnbm.dynamic.datasource.annotation.DataSource; | ||||
| import com.cnbm.packing.dto.CamlineExtendArgDTO; | ||||
| import com.cnbm.packing.dto.CamlineSubIdDTO; | ||||
| import com.cnbm.packing.dto.WoPowerLevelDTO; | ||||
| import com.cnbm.packing.mapper.CamlineMapper; | ||||
|  | ||||
| @@ -41,6 +42,12 @@ public class DynamicDataSourceService { | ||||
|         return mapper.getOrderNameBySubId(subId); | ||||
|     } | ||||
|  | ||||
|     @DataSource("camline") | ||||
|     @Transactional | ||||
|     public CamlineSubIdDTO getSubIdByCamline(String subId){ | ||||
|         return mapper.getSubIdByCamline(subId); | ||||
|     } | ||||
|  | ||||
|     @DataSource("camline") | ||||
|     @Transactional | ||||
|     public CamlineExtendArgDTO getExtendArgFromCamline(String subId){ | ||||
|   | ||||
| @@ -35,5 +35,7 @@ public interface WoPackagingBoxSubstrateServiceBiz extends CrudService<WoPackagi | ||||
|     void insertSubstrateManual(ChangePackingBoxDTO dto); | ||||
|  | ||||
|     WoPackagingBoxSubstrate getBySubId(String subId); | ||||
|     int updatePackagingBoxIdByWoSubstrateId(String packagingBoxId,String woSubstrateId); | ||||
|  | ||||
|  | ||||
|     int updatePackagingBoxIdAndSlotByWoSubstrateId(String packagingBoxId,Integer slot,String woSubstrateId); | ||||
| } | ||||
| @@ -98,8 +98,11 @@ public class WoCompensationPowerServiceBizImpl extends CrudServiceImpl<WoCompens | ||||
|  | ||||
|  | ||||
|         CompensationPowerXSDTO conffBySubIdAndLineBody = mapper.getConffBySubIdAndLineBody(compensationQueryParam); | ||||
|         float res = pmpp*conffBySubIdAndLineBody.getA()+conffBySubIdAndLineBody.getB(); | ||||
|         return res; | ||||
|         if(conffBySubIdAndLineBody!=null){ | ||||
|             return pmpp*conffBySubIdAndLineBody.getA()+conffBySubIdAndLineBody.getB(); | ||||
|         }else { | ||||
|             return pmpp; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -183,7 +183,7 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public int updatePackagingBoxIdByWoSubstrateId(String packagingBoxId, String woSubstrateId) { | ||||
|         return mapper.updatePackagingBoxIdByWoSubstrateId(packagingBoxId,woSubstrateId); | ||||
|     public int updatePackagingBoxIdAndSlotByWoSubstrateId(String packagingBoxId, Integer slot , String woSubstrateId) { | ||||
|         return mapper.updatePackagingBoxIdAndSlotByWoSubstrateId(packagingBoxId,slot,woSubstrateId); | ||||
|     } | ||||
| } | ||||
| @@ -7,6 +7,11 @@ | ||||
|         <result column="platform_id" property="platformId" /> | ||||
|         <result column="create_time" property="createTime" /> | ||||
|     </resultMap> | ||||
|     <resultMap id="ResultMapCam" type="com.cnbm.packing.dto.CamlineSubIdDTO"> | ||||
|         <result column="power_level" property="powerLevel" /> | ||||
|         <result column="sap_material" property="sapMaterial" /> | ||||
|     </resultMap> | ||||
|  | ||||
|     <resultMap id="ResultAMap" type="com.cnbm.packing.dto.CamlineExtendArgDTO"> | ||||
|         <result column="LAST_UPDATE_TIME" property="lastUpdateTime" /> | ||||
|         <result column="PMPP" property="pmpp" /> | ||||
| @@ -118,6 +123,20 @@ | ||||
|         LIMIT 1 | ||||
|     </select> | ||||
|  | ||||
|  | ||||
|     <select id="getSubIdByCamline" resultMap="ResultMapCam"> | ||||
|         SELECT | ||||
|             flc.SAP_Material as sap_material, | ||||
|             flc.Nenn_Leistung as power_level | ||||
|  | ||||
|         FROM | ||||
|             ue_flasher_data_calc flc | ||||
|                 LEFT JOIN e_tracking_unit tu ON flc.mainid = tu.id | ||||
|         WHERE | ||||
|             flc.PMPP != 0 | ||||
|           and tu.name = #{subId} | ||||
|     </select> | ||||
|  | ||||
|     <select id="getOrderNameBySubId" resultType="string"> | ||||
|         SELECT | ||||
|             eorder.name | ||||
|   | ||||
| @@ -41,7 +41,7 @@ | ||||
|               and twcp.line_body = #{param.lineBody} | ||||
|           </if> | ||||
|           <if test="param.pmpp != null"> | ||||
|               and twcp.actl_pmpp_high <![CDATA[ >= ]]> #{param.pmpp} and  twcp.actl_pmpp_low <![CDATA[ <= ]]> #{param.pmpp} | ||||
|               and twcp.actl_pmpp_high <![CDATA[ > ]]> #{param.pmpp} and  twcp.actl_pmpp_low <![CDATA[ <= ]]> #{param.pmpp} | ||||
|           </if> | ||||
|  | ||||
|     </select> | ||||
|   | ||||
| @@ -72,9 +72,12 @@ | ||||
|         WO_SUBSTRATE_ID = #{woSubstrateId,jdbcType=VARCHAR} | ||||
|         limit 1 | ||||
|     </select> | ||||
|     <update id="updatePackagingBoxIdByWoSubstrateId"> | ||||
|  | ||||
|  | ||||
|     <update id="updatePackagingBoxIdAndSlotByWoSubstrateId"> | ||||
|         update t_wo_packaging_box_substrate | ||||
|         set PACKAGING_BOX_ID = #{packagingBoxId,jdbcType=VARCHAR} | ||||
|         set PACKAGING_BOX_ID = #{packagingBoxId,jdbcType=VARCHAR}, | ||||
|             SLOT             = #{slot,jdbcType=NUMERIC} | ||||
|         where WO_SUBSTRATE_ID = #{woSubstrateId,jdbcType=VARCHAR} | ||||
|     </update> | ||||
|  | ||||
|   | ||||
| @@ -38,7 +38,7 @@ | ||||
|             and twpl.line_body = #{param.lineBody} | ||||
|         </if> | ||||
|         <if test="param.pmpp != null"> | ||||
|             and twpl.pmpp_high <![CDATA[ >= ]]> #{param.pmpp} and  twpl.pmpp_low <![CDATA[ <= ]]> #{param.pmpp} | ||||
|             and twpl.pmpp_high <![CDATA[ > ]]> #{param.pmpp} and  twpl.pmpp_low <![CDATA[ <= ]]> #{param.pmpp} | ||||
|         </if> | ||||
|     </select> | ||||
|  | ||||
|   | ||||
| @@ -27,7 +27,7 @@ public enum S7Client { | ||||
| //    S7_1200("192.168.0.52",0,1,1,PlcVarActual.HeartBeatFor1200), | ||||
| //    S7_15001("192.168.0.51",0,1,1), | ||||
| //    S7_1500("192.168.0.51",0,1,1), | ||||
|     S7_KUKA("10.10.3.158",0,1,1), | ||||
|     S7_KUKA("10.10.3.158",0,1,2), | ||||
|     //1500  机架-0  插槽-1 | ||||
|     //后续 在这里扩展 多PLC应用。 | ||||
|     ; | ||||
|   | ||||
		Referens i nytt ärende
	
	Block a user