Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
| | |
| | | { |
| | | "plcAddressBegin": "DB100.0", |
| | | "plcAddressLenght": "142", |
| | | "plcAddressBegin": "DB11.0", |
| | | "plcAddressLenght": "92", |
| | | "dataType": "word", |
| | | "parameteInfor": [ |
| | | |
| | | { |
| | | "codeId": "RequestWord", |
| | | "codeId": "requestWord", |
| | | "addressIndex": "0", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04ID", |
| | | "codeId": "requestID", |
| | | "addressIndex": "2", |
| | | "addressLenght": "2" |
| | | "addressLenght": "30" |
| | | }, |
| | | { |
| | | "codeId": "G06RobotTaskRequestWord", |
| | | "addressIndex": "4", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06ID", |
| | | "addressIndex": "6", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11RobotTaskRequestWord", |
| | | "addressIndex": "8", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G011ID", |
| | | "addressIndex": "10", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "12", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "14", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "16", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "18", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "MESSendingWord", |
| | | "addressIndex": "20", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InputGrid", |
| | | "addressIndex": "22", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "OutputGrid", |
| | | "addressIndex": "24", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "OutputID", |
| | | "addressIndex": "26", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "FrontOrRearLowerSlice", |
| | | "addressIndex": "28", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "30", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06RobotTaskReply", |
| | | "codeId": "currentCell", |
| | | "addressIndex": "32", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06Rack", |
| | | "addressIndex": "34", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11RobotTaskReply", |
| | | "codeId": "glassStatus08", |
| | | "addressIndex": "36", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11Rack", |
| | | "addressIndex": "38", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "glassStatus06", |
| | | "addressIndex": "40", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "glassStatus11", |
| | | "addressIndex": "42", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "glassStatus13", |
| | | "addressIndex": "44", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "46", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "G04_error_status", |
| | | "addressIndex": "48", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "G05_error_status", |
| | | "addressIndex": "50", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "G06_error_status", |
| | | "addressIndex": "52", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "robot_error_status", |
| | | "addressIndex": "54", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "MESTaskState", |
| | | "codeId": "G08_error_status", |
| | | "addressIndex": "56", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "G09_error_status", |
| | | "addressIndex": "58", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "AlarmState", |
| | | "codeId": "G10_error_status", |
| | | "addressIndex": "60", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm1", |
| | | "codeId": "G11_error_status", |
| | | "addressIndex": "62", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm2", |
| | | "codeId": "robot_error_status", |
| | | "addressIndex": "64", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm3", |
| | | "codeId": "G13_error_status", |
| | | "addressIndex": "66", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm4", |
| | | "addressIndex": "68", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "neirong", |
| | | "addressIndex": "70", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "device", |
| | | "codeId": "confirmationWord", |
| | | "addressIndex": "72", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "G06_prohibit_film_production", |
| | | "addressIndex": "74", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "G11_prohibit_film_production", |
| | | "addressIndex": "76", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut1", |
| | | "codeId": "G13_prohibit_film_production", |
| | | "addressIndex": "78", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut2", |
| | | "codeId": "Glass_width", |
| | | "addressIndex": "80", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut3", |
| | | "codeId": "Glass_height", |
| | | "addressIndex": "82", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut4", |
| | | "codeId": "Glass_thickness", |
| | | "addressIndex": "84", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut5", |
| | | "codeId": "Start_cell", |
| | | "addressIndex": "86", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut6", |
| | | "codeId": "End_cell", |
| | | "addressIndex": "88", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut7", |
| | | "codeId": "task_type", |
| | | "addressIndex": "90", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "92", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "94", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "96", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "98", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "100", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04ActionState", |
| | | "addressIndex": "102", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G05ActionState", |
| | | "addressIndex": "104", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06ActionState", |
| | | "addressIndex": "106", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G07ActionState", |
| | | "addressIndex": "108", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G08ActionState", |
| | | "addressIndex": "110", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G09ActionState", |
| | | "addressIndex": "112", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G10ActionState", |
| | | "addressIndex": "114", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11ActionState", |
| | | "addressIndex": "116", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G12ActionState", |
| | | "addressIndex": "118", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13ActionState", |
| | | "addressIndex": "120", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04IDS", |
| | | "addressIndex": "122", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G05IDS", |
| | | "addressIndex": "124", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06IDS", |
| | | "addressIndex": "126", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G07IDS", |
| | | "addressIndex": "128", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G08IDS", |
| | | "addressIndex": "130", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G09IDS", |
| | | "addressIndex": "132", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G10IDS", |
| | | "addressIndex": "134", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11IDS", |
| | | "addressIndex": "136", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G12IDS", |
| | | "addressIndex": "138", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13ID", |
| | | "addressIndex": "140", |
| | | "addressLenght": "2" |
| | | } |
| | | |
| | | ] |
| | | } |
| | |
| | | { |
| | | "plcAddressBegin": "DB100.0", |
| | | "plcAddressLenght": "142", |
| | | "plcAddressBegin": "DB11.0", |
| | | "plcAddressLenght": "100", |
| | | "dataType": "word", |
| | | "parameteInfor": [ |
| | | |
| | | { |
| | | "codeId": "RequestWord", |
| | | "codeId": "requestWord", |
| | | "addressIndex": "0", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04ID", |
| | | "codeId": "requestID", |
| | | "addressIndex": "2", |
| | | "addressLenght": "2" |
| | | "addressLenght": "30" |
| | | }, |
| | | { |
| | | "codeId": "G06RobotTaskRequestWord", |
| | | "addressIndex": "4", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06ID", |
| | | "addressIndex": "6", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11RobotTaskRequestWord", |
| | | "addressIndex": "8", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G011ID", |
| | | "addressIndex": "10", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "12", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "14", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "16", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "18", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "MESSendingWord", |
| | | "addressIndex": "20", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InputGrid", |
| | | "addressIndex": "22", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "OutputGrid", |
| | | "addressIndex": "24", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "OutputID", |
| | | "addressIndex": "26", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "FrontOrRearLowerSlice", |
| | | "addressIndex": "28", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "30", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06RobotTaskReply", |
| | | "codeId": "currentCell", |
| | | "addressIndex": "32", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06Rack", |
| | | "addressIndex": "34", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11RobotTaskReply", |
| | | "codeId": "glassStatus08", |
| | | "addressIndex": "36", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11Rack", |
| | | "addressIndex": "38", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "G06_glass_status", |
| | | "addressIndex": "40", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "G11_glass_status", |
| | | "addressIndex": "42", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "G13_glass_status", |
| | | "addressIndex": "44", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "46", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "G04_error_status", |
| | | "addressIndex": "48", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "G05_error_status", |
| | | "addressIndex": "50", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "G06_error_status", |
| | | "addressIndex": "52", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "robot_error_status", |
| | | "addressIndex": "54", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "MESTaskState", |
| | | "codeId": "G08_error_status", |
| | | "addressIndex": "56", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "G09_error_status", |
| | | "addressIndex": "58", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "AlarmState", |
| | | "codeId": "G10_error_status", |
| | | "addressIndex": "60", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm1", |
| | | "codeId": "G11_error_status", |
| | | "addressIndex": "62", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm2", |
| | | "codeId": "robot_error_status", |
| | | "addressIndex": "64", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm3", |
| | | "codeId": "G13_error_status", |
| | | "addressIndex": "66", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm4", |
| | | "addressIndex": "68", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "neirong", |
| | | "addressIndex": "70", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "device", |
| | | "codeId": "confirmationWord", |
| | | "addressIndex": "72", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "G06_prohibit_film_production", |
| | | "addressIndex": "74", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "G11_prohibit_film_production", |
| | | "addressIndex": "76", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut1", |
| | | "codeId": "G13_prohibit_film_production", |
| | | "addressIndex": "78", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut2", |
| | | "addressIndex": "80", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut3", |
| | | "codeId": "Glass_width", |
| | | "addressIndex": "82", |
| | | "addressLenght": "2" |
| | | "addressLenght": "4" |
| | | }, |
| | | { |
| | | "codeId": "InOut4", |
| | | "addressIndex": "84", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut5", |
| | | "codeId": "Glass_height", |
| | | "addressIndex": "86", |
| | | "addressLenght": "2" |
| | | "addressLenght": "4" |
| | | }, |
| | | { |
| | | "codeId": "InOut6", |
| | | "addressIndex": "88", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut7", |
| | | "codeId": "Glass_thickness", |
| | | "addressIndex": "90", |
| | | "addressLenght": "2" |
| | | "addressLenght": "4" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "92", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "Start_cell", |
| | | "addressIndex": "94", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "End_cell", |
| | | "addressIndex": "96", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "codeId": "task_type", |
| | | "addressIndex": "98", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "100", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04ActionState", |
| | | "addressIndex": "102", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G05ActionState", |
| | | "addressIndex": "104", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06ActionState", |
| | | "addressIndex": "106", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G07ActionState", |
| | | "addressIndex": "108", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G08ActionState", |
| | | "addressIndex": "110", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G09ActionState", |
| | | "addressIndex": "112", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G10ActionState", |
| | | "addressIndex": "114", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11ActionState", |
| | | "addressIndex": "116", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G12ActionState", |
| | | "addressIndex": "118", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13ActionState", |
| | | "addressIndex": "120", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04IDS", |
| | | "addressIndex": "122", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G05IDS", |
| | | "addressIndex": "124", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06IDS", |
| | | "addressIndex": "126", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G07IDS", |
| | | "addressIndex": "128", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G08IDS", |
| | | "addressIndex": "130", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G09IDS", |
| | | "addressIndex": "132", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G10IDS", |
| | | "addressIndex": "134", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11IDS", |
| | | "addressIndex": "136", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G12IDS", |
| | | "addressIndex": "138", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13ID", |
| | | "addressIndex": "140", |
| | | "addressLenght": "2" |
| | | } |
| | | |
| | | ] |
| | | } |
| | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.microsoft.sqlserver</groupId> |
| | | <artifactId>sqljdbc4</artifactId> |
| | | <version>4.0</version> |
| | | <artifactId>mssql-jdbc</artifactId> |
| | | <version>6.4.0.jre8</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | |
| | | * 宽 |
| | | */ |
| | | @ApiModelProperty(value = "宽") |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 格子号 |
| | |
| | | * 卧式理片笼详情表玻璃状态 |
| | | * 进片任务1 |
| | | * 出片任务2 |
| | | * 出片任务2 |
| | | */ |
| | | public static final Integer GLASS_CACHE_TYPE_IN = 1; |
| | | public static final Integer GLASS_CACHE_TYPE_OUT = 2; |
| | |
| | | public static final Integer TEMPERING_DAMAGE =5; |
| | | public static final Integer TEMPERING_TAKE =6; |
| | | |
| | | /** |
| | | * 下片 |
| | | */ |
| | | /** |
| | | * 执行线路格子信息 |
| | | */ |
| | | public static final List<Integer> G06_WORK_STATION = Arrays.asList(1, 2, 3); |
| | | public static final List<Integer> G11_WORK_STATION = Arrays.asList(4, 5, 6); |
| | | public static final List<Integer> G13_WORK_STATION = Arrays.asList(7); |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.damage.controller; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-06-13 |
| | | * @since 2024-06-25 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/glassinfo/damage") |
| | | @RequestMapping("/damage") |
| | | public class DamageController { |
| | | |
| | | @Autowired |
| | | private DamageService damageService; |
| | | @ApiOperation("报工数据查询") |
| | | @GetMapping("/selectDamage") |
| | | public Result selectDamage(DateTime startTime , DateTime endTime,int type,int status,int workingProcedureId) { |
| | | return Result.build(200,"查询成功",damageService.selectDamage(startTime,endTime,type,status,workingProcedureId)); |
| | | } |
| | | |
| | | @ApiOperation("报工") |
| | | @GetMapping("/submitDamage") |
| | | public Result submitDamage(DateTime startTime , DateTime endTime,int type,int status,int workingProcedureId) { |
| | | damageService.submitDamage(startTime,endTime,type,status,workingProcedureId); |
| | | return Result.build(200,"报工成功",1); |
| | | } |
| | | |
| | | @ApiOperation("报工数据修改") |
| | | @GetMapping("/updateDamage") |
| | | public Result updateDamage(List<Damage> damageList) { |
| | | damageService.updateBatchById(damageList); |
| | | return Result.build(200,"修改成功",1); |
| | | } |
| | | } |
| | | |
| | |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-06-13 |
| | | * @since 2024-06-25 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 工序 |
| | | */ |
| | | private Integer workingProcedureId; |
| | | |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | private String glassId; |
| | | |
| | | private Integer deviceId; |
| | | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | private String engineerId; |
| | | |
| | | /** |
| | | * 钢化版图id |
| | | */ |
| | | private Integer temperingLayoutId; |
| | | |
| | | /** |
| | | * 生产时间 |
| | | */ |
| | | private LocalDateTime damageTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 类型:0:报工 1:破损 2:拿走 |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 状态:0:未报工 1:已报工 |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 流程卡 |
| | | */ |
| | | private Integer processId; |
| | | |
| | | /** |
| | | * 序号 |
| | | */ |
| | | private Integer orderNumber; |
| | | |
| | | /** |
| | | * 工艺确认序号 |
| | | */ |
| | | private Integer technologyNumber; |
| | | |
| | | /** |
| | | * 破损类型 |
| | | */ |
| | | private String breakageType; |
| | | |
| | | /** |
| | | * 破损原因 |
| | | */ |
| | | private String breakageReason; |
| | | |
| | | /** |
| | | * 责任工序 |
| | | */ |
| | | private String responsibleProcess; |
| | | |
| | | /** |
| | | * 责任人员 |
| | | */ |
| | | private String responsiblePersonnel; |
| | | |
| | | /** |
| | | * 责任班组 |
| | | */ |
| | | private String responsibleTeam; |
| | | |
| | | /** |
| | | * 责任设备 |
| | | */ |
| | | private String responsibleEquipment; |
| | | |
| | | /** |
| | | * 报工班组名称 |
| | | */ |
| | | private String teamsGroupsName; |
| | | |
| | | /** |
| | | * 报工设备名称 |
| | | */ |
| | | private String deviceName; |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.damage.service; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface DamageService extends IService<Damage> { |
| | | |
| | | List<Damage> selectDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId); |
| | | |
| | | void submitDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId); |
| | | |
| | | void insertDamage(String glassId); |
| | | } |
| | |
| | | package com.mes.damage.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.mapper.DamageMapper; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class DamageServiceImpl extends ServiceImpl<DamageMapper, Damage> implements DamageService { |
| | | |
| | | @Override |
| | | public List<Damage> selectDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId){ |
| | | LambdaQueryWrapper<Damage> damageSelectWrapper =new LambdaQueryWrapper<>(); |
| | | damageSelectWrapper.between(Damage::getDamageTime,startTime,endTime); |
| | | if (type!=0){ |
| | | damageSelectWrapper.eq(Damage::getType,type); |
| | | } |
| | | if (status!=0){ |
| | | damageSelectWrapper.eq(Damage::getStatus,status); |
| | | } |
| | | if(workingProcedureId!=0){ |
| | | damageSelectWrapper.eq(Damage::getWorkingProcedureId,workingProcedureId); |
| | | } |
| | | return baseMapper.selectList(damageSelectWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void submitDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId){ |
| | | LambdaUpdateWrapper<Damage> damageUpdateWrapper=new LambdaUpdateWrapper<>(); |
| | | damageUpdateWrapper.between(Damage::getDamageTime,startTime,endTime); |
| | | if (type!=0){ |
| | | damageUpdateWrapper.eq(Damage::getType,type); |
| | | } |
| | | if (status!=0){ |
| | | damageUpdateWrapper.eq(Damage::getStatus,status); |
| | | } |
| | | if(workingProcedureId!=0){ |
| | | damageUpdateWrapper.eq(Damage::getWorkingProcedureId,workingProcedureId); |
| | | } |
| | | Damage damage=new Damage(); |
| | | damage.setStatus(2); |
| | | baseMapper.update(damage,damageUpdateWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void insertDamage(String glassId){ |
| | | LambdaQueryWrapper<GlassInfo> glassInfoSelectWrapper=new LambdaQueryWrapper<>(); |
| | | GlassInfo glassInfo=new GlassInfo(); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double thickness; |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 膜系 |
| | |
| | | /** |
| | | * 磨前宽 |
| | | */ |
| | | private Double edgWidth; |
| | | private double edgWidth; |
| | | |
| | | /** |
| | | * 磨前高 |
| | | */ |
| | | private Double edgHeight; |
| | | private double edgHeight; |
| | | |
| | | /** |
| | | * 是否配片 |
| | |
| | | /** |
| | | * 配片最大宽 |
| | | */ |
| | | private Double maxWidth; |
| | | private double maxWidth; |
| | | |
| | | /** |
| | | * 配片最大高 |
| | | */ |
| | | private Double maxHeight; |
| | | private double maxHeight; |
| | | |
| | | /** |
| | | * 钢化是否接受横放 |
| | |
| | | /** |
| | | * 旋转角度(逆时针) |
| | | */ |
| | | private Double angle; |
| | | private double angle; |
| | | |
| | | /** |
| | | * 工程号 |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double oHeight; |
| | | private double oHeight; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double oWidth; |
| | | private double oWidth; |
| | | |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double glassThickness; |
| | | private double glassThickness; |
| | | |
| | | /** |
| | | * 玻璃膜系 |
| | |
| | | /** |
| | | * 小片宽(加磨量) |
| | | */ |
| | | private Double pWidth; |
| | | private double pWidth; |
| | | /** |
| | | * 小片高(加磨量) |
| | | */ |
| | | private Double pHeight; |
| | | private double pHeight; |
| | | /** |
| | | * 版图id |
| | | */ |
| | |
| | | /** |
| | | * 旋转角度 |
| | | */ |
| | | private Double rotateAngle; |
| | | private double rotateAngle; |
| | | |
| | | } |
| | |
| | | /** |
| | | * 面积 |
| | | */ |
| | | private Double area; |
| | | private double area; |
| | | |
| | | |
| | | /** |
| | |
| | | package com.mes.order.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | /** |
| | | * 面积 |
| | | */ |
| | | private Double area; |
| | | private double area; |
| | | |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 小片宽(加磨量) |
| | | */ |
| | | private Double pWidth; |
| | | private double pWidth; |
| | | |
| | | /** |
| | | * 小片高(加磨量) |
| | | */ |
| | | private Double pHeight; |
| | | private double pHeight; |
| | | |
| | | /** |
| | | * 小片宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 小片高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * x坐标 |
| | | */ |
| | | private Double xAxis; |
| | | private double xAxis; |
| | | |
| | | /** |
| | | * y坐标 |
| | | */ |
| | | private Double yAxis; |
| | | private double yAxis; |
| | | |
| | | /** |
| | | * 钢化版图编号(架号) |
| | |
| | | */ |
| | | private Integer stockId; |
| | | |
| | | private Double width; |
| | | private double width; |
| | | |
| | | private Double height; |
| | | private double height; |
| | | |
| | | private Double realwidth; |
| | | private double realwidth; |
| | | |
| | | private Double realheight; |
| | | private double realheight; |
| | | |
| | | /** |
| | | * 切裁率 |
| | |
| | | /** |
| | | * 总面积 |
| | | */ |
| | | private Double glassTotalArea; |
| | | private double glassTotalArea; |
| | | |
| | | /** |
| | | * 流程卡数量 |
| | |
| | | /** |
| | | * 第一次平均切裁率 |
| | | */ |
| | | private Double fristCutPct; |
| | | private double fristCutPct; |
| | | |
| | | /** |
| | | * 使用的原料数 |
| | |
| | | /** |
| | | * 使用的原料面积 |
| | | */ |
| | | private Double rawStockArea; |
| | | private double rawStockArea; |
| | | |
| | | /** |
| | | * 平均切裁率 |
| | | */ |
| | | private Double avgCutPct; |
| | | private double avgCutPct; |
| | | |
| | | /** |
| | | * 有效切裁率 |
| | | */ |
| | | private Double validCutPct; |
| | | private double validCutPct; |
| | | |
| | | /** |
| | | * 尾片切裁率 |
| | | */ |
| | | private Double lastCutPct; |
| | | private double lastCutPct; |
| | | |
| | | /** |
| | | * g混排程度 |
| | |
| | | /** |
| | | * g上片宽 |
| | | */ |
| | | private Double loadWidth; |
| | | private double loadWidth; |
| | | |
| | | /** |
| | | * g上片长 |
| | | */ |
| | | private Double loadLength; |
| | | private double loadLength; |
| | | |
| | | /** |
| | | * x间隔 |
| | | */ |
| | | private Double xSpace; |
| | | private double xSpace; |
| | | |
| | | /** |
| | | * y间隔 |
| | | */ |
| | | private Double ySpace; |
| | | private double ySpace; |
| | | |
| | | /** |
| | | * g平均装载率 |
| | | */ |
| | | private Double loadRate; |
| | | private double loadRate; |
| | | |
| | | /** |
| | | * 流程卡集合 |
| | |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 形状 |
| | |
| | | /** |
| | | * 次破面积 |
| | | */ |
| | | private Double patchArea; |
| | | private double patchArea; |
| | | |
| | | /** |
| | | * 质检员 |
| | |
| | | * 高 |
| | | */ |
| | | @ApiModelProperty(value = "高", position = 7) |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | @ApiModelProperty(value = "厚度", position = 8) |
| | | private Double thickness; |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 膜系 |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double thickness; |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 原片版图片序 |
| | |
| | | <artifactId>junit</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.microsoft.sqlserver</groupId> |
| | | <artifactId>sqljdbc4</artifactId> |
| | | <version>4.0</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.samba.jcifs</groupId> |
| | | <artifactId>jcifs</artifactId> |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double thickness; |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 磨前宽 |
| | | */ |
| | | private Double edgWidth; |
| | | private double edgWidth; |
| | | |
| | | /** |
| | | * 磨前高 |
| | | */ |
| | | private Double edgHeight; |
| | | private double edgHeight; |
| | | |
| | | /** |
| | | * 钢化版图id |
| | |
| | | |
| | | /** |
| | | * 查询笼内离指定格子最近空格 |
| | | * flag :是否为直通 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | * @return |
| | | */ |
| | | public GlassInfo queryAndChangeGlass(String glassId) { |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId) |
| | | .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1")); |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | // .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1")); |
| | | Assert.isFalse(null == glassInfo, "玻璃信息不存在"); |
| | | //按照玻璃尺寸 |
| | | LambdaQueryWrapper<GlassInfo> queryWrapper = new LambdaQueryWrapper<GlassInfo>() |
| | |
| | | List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(wrapper); |
| | | if (CollectionUtil.isEmpty(list)) { |
| | | MPJQueryWrapper<GlassInfo> queryWrapper = new MPJQueryWrapper<GlassInfo>() |
| | | .selectAll(GlassInfo.class).eq("t.glass_id", glassId) |
| | | .inSql("t.engineer_id", "select engineer_id from engineering where state = 1"); |
| | | .selectAll(GlassInfo.class).eq("t.glass_id", glassId); |
| | | // .inSql("t.engineer_id", "select engineer_id from engineering where state = 1"); |
| | | if (endcell == Const.A10_OUT_TARGET_POSITION) { |
| | | queryWrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from glass_info) t1 " + |
| | |
| | | //todo: 获取正在执行的工程信息 |
| | | if (StringUtils.isNotBlank(glassId)) { |
| | | GlassInfo one = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getGlassId, glassId) |
| | | .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1")); |
| | | .eq(GlassInfo::getGlassId, glassId)); |
| | | // .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1")); |
| | | EdgStorageCageDetails resultDetails = new EdgStorageCageDetails(); |
| | | BeanUtils.copyProperties(one, resultDetails); |
| | | glassList.add(resultDetails); |
| | |
| | | * @param width |
| | | * @param height |
| | | */ |
| | | private EdgStorageCageDetails queryMinGlass(Double width, Double height, String glassId) { |
| | | private EdgStorageCageDetails queryMinGlass(double width, double height, String glassId) { |
| | | //获取表内版图id最小的玻璃信息 |
| | | EdgStorageCageDetails glassDetails = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getState, 100) |
| | |
| | | } |
| | | GlassInfo one = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getGlassId, glassId) |
| | | .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1") |
| | | // .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1") |
| | | ); |
| | | EdgStorageCageDetails resultDetails = new EdgStorageCageDetails(); |
| | | BeanUtils.copyProperties(one, resultDetails); |
| | |
| | | return null; |
| | | } |
| | | return edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getGlassId, taskCache.getGlassId()) |
| | | .inSql(EdgStorageCageDetails::getEngineerId, "select engineer_id from engineering where state = 1").last(" limit 1 ")); |
| | | // .inSql(EdgStorageCageDetails::getEngineerId, "select engineer_id from engineering where state = 1") |
| | | .last(" limit 1 ")); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private Integer queryLineByGlassInfo(EdgStorageCageDetails a08EdgStorageCageDetails, EdgStorageCageDetails a10EdgStorageCageDetails, |
| | | EdgStorageCageDetails glassInfo, int out08Glassstate, int out10Glassstate) { |
| | | boolean b08 = a08EdgStorageCageDetails != null && a08EdgStorageCageDetails.getHeight().equals(glassInfo.getHeight()) |
| | | && a08EdgStorageCageDetails.getWidth().equals(glassInfo.getWidth()); |
| | | boolean b10 = a10EdgStorageCageDetails != null && a10EdgStorageCageDetails.getHeight().equals(glassInfo.getHeight()) |
| | | && a10EdgStorageCageDetails.getWidth().equals(glassInfo.getWidth()); |
| | | boolean b08 = a08EdgStorageCageDetails != null && a08EdgStorageCageDetails.getHeight() == glassInfo.getHeight() |
| | | && a08EdgStorageCageDetails.getWidth() == glassInfo.getWidth(); |
| | | boolean b10 = a10EdgStorageCageDetails != null && a10EdgStorageCageDetails.getHeight() == glassInfo.getHeight() |
| | | && a10EdgStorageCageDetails.getWidth() == glassInfo.getWidth(); |
| | | //存在出片任务 07为空 |
| | | if (b10) { |
| | | return out10Glassstate == 2 ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | |
| | | //获取宽高拍第一的玻璃信息 |
| | | EdgStorageCageDetails firstSize = list.get(0); |
| | | Integer firstCount = firstSize.getCount(); |
| | | Double firstWidth = firstSize.getWidth(); |
| | | Double firstHeight = firstSize.getHeight(); |
| | | double firstWidth = firstSize.getWidth(); |
| | | double firstHeight = firstSize.getHeight(); |
| | | if (list.size() == 1) { |
| | | return queryMinGlass(firstWidth, firstHeight, glassId); |
| | | } |
| | | //获取宽高拍第二的玻璃信息 |
| | | EdgStorageCageDetails secondSize = list.get(1); |
| | | Integer secondCount = secondSize.getCount(); |
| | | Double secondWidth = secondSize.getWidth(); |
| | | Double secondHeight = secondSize.getHeight(); |
| | | double secondWidth = secondSize.getWidth(); |
| | | double secondHeight = secondSize.getHeight(); |
| | | //获取数量前2的玻璃数量比例 |
| | | Integer mix = firstCount / secondCount; |
| | | log.info("获取玻璃数量前2的玻璃占比为:{}", mix); |
| | |
| | | EdgStorageCageDetails outGlassInfo = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getGlassId, taskCache.getGlassId())); |
| | | log.info("{}线有出片任务信息,任务信息为{},玻璃信息为{}", endcell, taskCache, outGlassInfo); |
| | | if (outGlassInfo.getWidth().equals(firstWidth) && outGlassInfo.getHeight().equals(firstHeight)) { |
| | | if (outGlassInfo.getWidth() == firstWidth && outGlassInfo.getHeight() == firstHeight) { |
| | | log.info("数量最多的宽{}高{}和{}线任务的宽{}高{}相同,出数量排第二的玻璃,宽{}高{}", |
| | | firstWidth, firstHeight, endcell, outGlassInfo.getWidth(), outGlassInfo.getHeight(), secondWidth, secondHeight); |
| | | return queryMinGlass(secondWidth, secondHeight, glassId); |
| | |
| | | <artifactId>junit</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.microsoft.sqlserver</groupId> |
| | | <artifactId>sqljdbc4</artifactId> |
| | | <version>4.0</version> |
| | | </dependency> |
| | | </dependencies> |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | |
| | | package com.mes.bigstorage.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @ApiOperation("玻璃详情查询") |
| | | @PostMapping("/selectBigStorageCageDetails") |
| | | public Result selectBigStorageCageDetails(String glassId) { |
| | | BigStorageCageDetails bigStorageCageDetails=bigStorageCageDetailsService.selectBigStorageCageDetails(glassId); |
| | | public Result selectBigStorageCageDetails(@RequestBody Map map) { |
| | | List<BigStorageCageDetails> bigStorageCageDetails=bigStorageCageDetailsService.selectBigStorageCageDetails(map.get("glassId").toString()); |
| | | return Result.build(200,"查询成功",bigStorageCageDetails); |
| | | } |
| | | |
| | | @ApiOperation("理片笼详情添加") |
| | | @PostMapping("/insertBigStorageCageDetails") |
| | | public Result insertBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | public Result insertBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.insertBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"添加成功",1); |
| | | } |
| | | |
| | | @ApiOperation("理片笼详情删除") |
| | | @PostMapping("/deleteBigStorageCageDetails") |
| | | public Result deleteBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | public Result deleteBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.deleteBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"删除成功",1); |
| | | } |
| | | |
| | | @ApiOperation("理片笼任务破损0/拿走1") |
| | | @PostMapping("/damageBigStorageCageDetails") |
| | | public Result damageBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails,int status) { |
| | | public Result damageBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails,int status) { |
| | | bigStorageCageDetailsService.damageBigStorageCageDetails(bigStorageCageDetails.getGlassId(),status); |
| | | return Result.build(200,"破损成功",1); |
| | | return Result.build(200,"破损/拿走成功",1); |
| | | } |
| | | |
| | | @ApiOperation("理片笼任务完成") |
| | | @PostMapping("/finishBigStorageCageDetails") |
| | | public Result finishBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | public Result finishBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.finishBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"破损成功",1); |
| | | return Result.build(200,"任务完成成功",1); |
| | | } |
| | | |
| | | @ApiOperation("理片笼任务出片") |
| | | @PostMapping("/outBigStorageCageDetails") |
| | | public Result outBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | public Result outBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | |
| | | bigStorageCageDetailsService.outBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"破损成功",1); |
| | | return Result.build(200,"出片添加成功",1); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | * 高 |
| | | */ |
| | | @ApiModelProperty(value = "高", position = 10) |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | @ApiModelProperty(value = "厚度", position = 11) |
| | | private Double thickness; |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 钢化版图id |
| | |
| | | |
| | | void damageBigStorageCageDetails(String glassId,int status); |
| | | |
| | | BigStorageCageDetails selectBigStorageCageDetails(String glassId); |
| | | List<BigStorageCageDetails> selectBigStorageCageDetails(String glassId); |
| | | |
| | | void insertBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails); |
| | | |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList |
| | | ) { |
| | | if (bigStorageCageDetails.getBigStorageCageFeedTask().getTaskState() == 0) { |
| | | carWidth -= Integer.parseInt(bigStorageCageDetails.getWidth().toString()) + galssGap; |
| | | carWidth = carWidth - bigStorageCageDetails.getWidth() - galssGap; |
| | | } |
| | | } |
| | | return carWidth; |
| | |
| | | } |
| | | temperingGlassInfoMapper.updateById(temperingGlassInfo); |
| | | } |
| | | baseMapper.deleteById(bigStorageCageDetails.getId()); |
| | | bigStorageCageDetails.setState(Const.BIG_STORAGE_OUTSIDE); |
| | | baseMapper.updateById(bigStorageCageDetails); |
| | | bigStorageCageService.updateRemainWidth(bigStorageCageDetails.getSlot()); |
| | | //todo:插入破损数据 |
| | | |
| | |
| | | |
| | | //查询玻璃信息 |
| | | @Override |
| | | public BigStorageCageDetails selectBigStorageCageDetails(String glassId) { |
| | | public List<BigStorageCageDetails> selectBigStorageCageDetails(String glassId) { |
| | | LambdaQueryWrapper<GlassInfo> glassInfoWrapper = new LambdaQueryWrapper<>(); |
| | | glassInfoWrapper.eq(GlassInfo::getGlassId, glassId); |
| | | GlassInfo glassInfo = glassInfoMapper.selectOne(glassInfoWrapper); |
| | | BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | if(glassInfo!=null){ |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | bigStorageCageDetails.setState(0); |
| | | bigStorageCageDetails.setGap(galssGap); |
| | | return bigStorageCageDetails; |
| | | } |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList=new ArrayList<>(); |
| | | bigStorageCageDetailsList.add(bigStorageCageDetails); |
| | | return bigStorageCageDetailsList; |
| | | } |
| | | |
| | | //理片笼详情添加 |
| | |
| | | public List<BigStorageCage> querybigStorageCageDetail(int deviceId) { |
| | | LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper =new LambdaQueryWrapper<>(); |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper =new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailsWrapper.lt(BigStorageCageDetails::getState, Const.BIG_STORAGE_OUTSIDE); |
| | | if(deviceId!=0){ |
| | | bigStorageCageWrapper.eq(BigStorageCage::getDeviceId,deviceId); |
| | | bigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getDeviceId,deviceId); |
| | |
| | | * 目标位置 |
| | | */ |
| | | @ApiModelProperty(value = "目标位置", position = 4) |
| | | private Integer targetSlot; |
| | | private int targetSlot; |
| | | |
| | | /** |
| | | * 玻璃类型 |
| | |
| | | * 线路 |
| | | */ |
| | | @ApiModelProperty(value = "线路", position = 7) |
| | | private Integer line; |
| | | private int line; |
| | | /** |
| | | * 宽度 |
| | | */ |
| | |
| | | public class S7object extends Thread { |
| | | public S7control plccontrol; // PLC通讯类实例 |
| | | private EPlcType plcType = EPlcType.S1200; // 西门子PLC类型 |
| | | private String ip = "192.168.10.1"; // plc ip地址 |
| | | private String ip = "192.168.20.100"; // plc ip地址 |
| | | private int port = 102; // plc 端口号 |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | byte[] getplcvlues = plccontrol.readByte(PlcMesObject.getPlcAddressBegin(), PlcMesObject.getPlcAddressLength()); |
| | | if (getplcvlues != null) { |
| | | PlcMesObject.setPlcParameterList(getplcvlues); |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | @Scheduled(fixedDelay = 5000) |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void plcStorageCageTask() throws InterruptedException { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | try { |
| | |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import com.mes.tools.S7control; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Value("${mes.galssGap}") |
| | | private Integer galssGap; |
| | | |
| | | @Scheduled(fixedDelay = 5000) |
| | | // @Scheduled(fixedDelay = 5000) |
| | | public void plcToHomeEdgScan() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String d01Request = plcParameterObject.getPlcParameter("D01Request").getValue(); |
| | | String d01Id = plcParameterObject.getPlcParameter("D01ID1").getValue(); |
| | | String d02SitState = plcParameterObject.getPlcParameter("D02SitState").getValue(); |
| | | String d04Request = plcParameterObject.getPlcParameter("D04Request").getValue(); |
| | | String d04Id = plcParameterObject.getPlcParameter("D04ID1").getValue(); |
| | | String d05SitState = plcParameterObject.getPlcParameter("D05SitState").getValue(); |
| | | String d01Id = plcParameterObject.getPlcParameter("D01ID").getValue(); |
| | | String d04Id = plcParameterObject.getPlcParameter("D04ID").getValue(); |
| | | String d03State = plcParameterObject.getPlcParameter("D03State").getValue(); |
| | | String d05State = plcParameterObject.getPlcParameter("D05State").getValue(); |
| | | String mesD03Address = plcParameterObject.getPlcParameter("MESToD03").getAddress(); |
| | | String mesD05Address = plcParameterObject.getPlcParameter("MESToD05").getAddress(); |
| | | |
| | | log.info("1、获取到的请求字d01为:{},获取到的扫描ID为:{};获取到的请求字d04为:{},获取到的扫描ID为:{};", |
| | | d01Request, d01Id, d04Request, d04Id); |
| | | if (!REQUEST_WORD.equals(d01Request) && !REQUEST_WORD.equals(d04Request)) { |
| | | |
| | | log.info("1、获取d01Id扫描ID为:{};获取d04Id扫描ID为:{};", d01Id, d04Id); |
| | | if (StringUtils.isBlank(d01Id) && StringUtils.isBlank(d04Id)) { |
| | | log.info("两条线未收到进片任务,结束本次扫描进卧转立任务"); |
| | | return; |
| | | } |
| | | if (REQUEST_WORD.equals(d02SitState) && REQUEST_WORD.equals(d05SitState)) { |
| | | if (REQUEST_WORD.equals(d03State) && REQUEST_WORD.equals(d05State)) { |
| | | log.info("两条线卧转立均在执行任务,结束本次扫描进卧转立任务"); |
| | | return; |
| | | } |
| | | Boolean flag01 = Boolean.FALSE; |
| | | Boolean flag04 = Boolean.FALSE; |
| | | // Boolean flag01 = Boolean.FALSE; |
| | | // Boolean flag04 = Boolean.FALSE; |
| | | //按照线路及玻璃id获取相邻两块玻璃 卧转立上的玻璃 |
| | | if (REQUEST_WORD.equals(d01Request) && !REQUEST_WORD.equals(d02SitState)) { |
| | | flag01 = judgeGlassTypeStatus(d01Id, Const.A09_OUT_TARGET_POSITION); |
| | | if (StringUtils.isNotBlank(d01Id) && !REQUEST_WORD.equals(d03State)) { |
| | | judgeGlassTypeStatus(d01Id, Const.A09_OUT_TARGET_POSITION, mesD03Address); |
| | | } |
| | | if (REQUEST_WORD.equals(d04Request) && !REQUEST_WORD.equals(d05SitState)) { |
| | | flag04 = judgeGlassTypeStatus(d04Id, Const.A10_OUT_TARGET_POSITION); |
| | | if (StringUtils.isNotBlank(d04Id) && !REQUEST_WORD.equals(d05State)) { |
| | | judgeGlassTypeStatus(d04Id, Const.A10_OUT_TARGET_POSITION, mesD05Address); |
| | | } |
| | | if (flag01 && flag04) { |
| | | //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | Integer startLine = getStartLine(); |
| | | //计算目标格子,发送启动任务 |
| | | computeTargetByLine(startLine); |
| | | } else if (flag01 || flag04) { |
| | | Integer startLine = flag01.equals(Boolean.TRUE) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | //计算目标格子,发送启动任务 |
| | | computeTargetByLine(startLine); |
| | | } else { |
| | | log.info("两条线未收到进片任务,结束本次扫描进卧转立任务"); |
| | | } |
| | | log.info("结束扫码任务"); |
| | | // if (flag01 && flag04) { |
| | | // //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | // Integer startLine = getStartLine(); |
| | | // //计算目标格子,发送启动任务 |
| | | // computeTargetByLine(startLine); |
| | | // } else if (flag01 || flag04) { |
| | | // Integer startLine = flag01.equals(Boolean.TRUE) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | // //计算目标格子,发送启动任务 |
| | | // computeTargetByLine(startLine); |
| | | // } else { |
| | | // log.info("两条线未收到进片任务,结束本次扫描进卧转立任务"); |
| | | // } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void plcToHomeEdgFreeCarTask() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String e01Status = plcParameterObject.getPlcParameter("E01Status").getValue(); |
| | | String e01Status = plcParameterObject.getPlcParameter("E01State").getValue(); |
| | | if (REQUEST_WORD.equals(e01Status)) { |
| | | log.info("进片大车非空闲"); |
| | | return; |
| | | } |
| | | String d01Request = plcParameterObject.getPlcParameter("D01Request").getValue(); |
| | | String d01Id = plcParameterObject.getPlcParameter("D01ID1").getValue(); |
| | | String d04Request = plcParameterObject.getPlcParameter("D04Request").getValue(); |
| | | String d04Id = plcParameterObject.getPlcParameter("D04ID1").getValue(); |
| | | log.info("1、获取到的请求字d01为:{},获取到的扫描ID为:{};获取到的请求字d04为:{},获取到的扫描ID为:{};", |
| | | d01Request, d01Id, d04Request, d04Id); |
| | | //两条线都有进卧转立任务,直接结束 |
| | | if (Const.BIG_STORAGE_REQUEST_IN.equals(d01Request) |
| | | && Const.BIG_STORAGE_REQUEST_IN.equals(d04Request)) { |
| | | log.info("两条线都存在进片任务,结束任务"); |
| | | List<BigStorageCageFeedTask> feedTaskList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .eq(BigStorageCageFeedTask::getTaskType, Const.BIG_STORAGE_IN_RUN) |
| | | .eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_UP)); |
| | | if (CollectionUtils.isNotEmpty(feedTaskList)) { |
| | | if (feedTaskList.size() == 1) { |
| | | computeTargetByLine(feedTaskList.get(0).getLine()); |
| | | return; |
| | | } else { |
| | | //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | Integer startLine = getStartLine(); |
| | | // //计算目标格子,发送启动任务 |
| | | computeTargetByLine(startLine); |
| | | return; |
| | | } |
| | | } |
| | | String d01Id = plcParameterObject.getPlcParameter("D01ID").getValue(); |
| | | String d04Id = plcParameterObject.getPlcParameter("D04ID").getValue(); |
| | | log.info("1、获取d01Id扫描ID为:{};获取d04Id扫描ID为:{};", d01Id, d04Id); |
| | | //两条线都有进卧转立任务,直接结束 |
| | | // if (StringUtils.isNotBlank(d01Id) && StringUtils.isNotBlank(d04Id)) { |
| | | // log.info("两条线都存在进片任务,结束任务"); |
| | | // return; |
| | | // } |
| | | //获取两条线卧转立是否有玻璃,且任务状态都为2 |
| | | List<Integer> lineList = bigStorageCageFeedTaskService.querySitToUpGlass(); |
| | | if (CollectionUtils.isEmpty(lineList)) { |
| | |
| | | } |
| | | Integer lineFirst = lineList.get(0); |
| | | String lineGlassId = lineFirst.equals(Const.A09_OUT_TARGET_POSITION) ? d01Id : d04Id; |
| | | //仅有一条先符合启动启动条件 |
| | | if (lineList.size() == 1) { |
| | | //计算任务表进片格子 发送进片任务 |
| | | //如果进片请求但玻璃为空,计算任务表进片格子 发送进片任务 |
| | | if (StringUtils.isEmpty(lineGlassId)) { |
| | | computeTargetByLine(lineFirst); |
| | | } else { |
| | | //todo:计算扫描到的玻璃是否可以存进卧转立 |
| | | //获取卧转立剩余宽度 |
| | | if (computeIsRun(lineFirst, lineGlassId)) { |
| | | computeTargetByLine(lineFirst); |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | //两条先均可执行进片任务,判断两条线是否进片请求是否都为空 |
| | | if (StringUtils.isBlank(d01Id) && StringUtils.isBlank(d04Id)) { |
| | | //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | Integer line = getStartLine(); |
| | | //计算任务表进片格子 发送进片任务 |
| | | computeTargetByLine(line); |
| | | return; |
| | | } |
| | | int outLine = StringUtils.isBlank(d01Id) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | } else if (StringUtils.isNotBlank(d01Id) && StringUtils.isNotBlank(d04Id)) { |
| | | // todo:两个都有进片玻璃 |
| | | if (computeIsRun(Const.A09_OUT_TARGET_POSITION, d01Id) && computeIsRun(Const.A10_OUT_TARGET_POSITION, d04Id)) { |
| | | //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | Integer line = getStartLine(); |
| | | //计算任务表进片格子 发送进片任务 |
| | | computeTargetByLine(line); |
| | | } else if (computeIsRun(Const.A09_OUT_TARGET_POSITION, d01Id)) { |
| | | computeTargetByLine(Const.A09_OUT_TARGET_POSITION); |
| | | } else if (computeIsRun(Const.A10_OUT_TARGET_POSITION, d04Id)) { |
| | | computeTargetByLine(Const.A10_OUT_TARGET_POSITION); |
| | | } else { |
| | | return; |
| | | } |
| | | } else { |
| | | //,或者仅有一条有玻璃 |
| | | //一条线为空,一条线有进片请求有玻璃 |
| | | int outLine = StringUtils.isBlank(d01Id) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | //获取进片请求玻璃为空的,计算任务表进片格子 发送进片任务 |
| | | computeTargetByLine(outLine); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 5000) |
| | | } |
| | | |
| | | // @Scheduled(fixedDelay = 5000) |
| | | public void plcToHomeEdgOutTask() { |
| | | |
| | | List<BigStorageCageOutTask> outingList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_NEW)); |
| | |
| | | /** |
| | | * 按照玻璃id判断玻璃状态及卧转立是否可直接启动 |
| | | */ |
| | | public Boolean judgeGlassTypeStatus(String glassId, Integer line) { |
| | | public Boolean judgeGlassTypeStatus(String glassId, Integer line, String mesAddress) { |
| | | //1、获取任务表中相邻玻璃 |
| | | List<EdgGlassTaskInfo> edgGlassTaskInfoList = edgGlassTaskInfoService.list(new LambdaQueryWrapper<EdgGlassTaskInfo>() |
| | | .eq(EdgGlassTaskInfo::getLine, line) |
| | |
| | | remainWidth = sitToUpRemainWidth.getWidth(); |
| | | glassCount = sitToUpRemainWidth.getGlassCount(); |
| | | } |
| | | |
| | | Boolean flag = Boolean.TRUE; |
| | | //2、获取卧转立 |
| | | Integer widthFirst = edgGlassTaskInfoList.get(0).getWidth(); |
| | | if (edgGlassTaskInfoList.size() == 1) { |
| | | if (remainWidth >= widthFirst) { |
| | | if (glassCount <= 5) { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst); |
| | | return Boolean.FALSE; |
| | | } else { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst); |
| | | return Boolean.TRUE; |
| | | } |
| | | } else { |
| | | flag = Boolean.FALSE; |
| | | } |
| | | } else { |
| | | Integer widthSecond = edgGlassTaskInfoList.get(1).getWidth(); |
| | |
| | | if (remainWidth - widthFirst - galssGap >= widthSecond) { |
| | | if (glassCount <= carMaxSize - 1) { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst); |
| | | return Boolean.FALSE; |
| | | } else { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst); |
| | | return Boolean.TRUE; |
| | | } |
| | | } else { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst); |
| | | } |
| | | } else { |
| | | flag = Boolean.FALSE; |
| | | } |
| | | } |
| | | //向plc发送进片确认 |
| | | if (flag) { |
| | | S7object.getinstance().plccontrol.writeWord(mesAddress, (short) 1); |
| | | } |
| | | //记录无法放下玻璃,后续判断启动 |
| | | return Boolean.TRUE; |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | |
| | | //2、去笼子内查找是否可以继续存放的笼子 |
| | | List<String> glassIds = taskList.stream().map(BigStorageCageFeedTask::getGlassId).collect(Collectors.toList()); |
| | | List<GlassInfo> glassInfos = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassIds)); |
| | | return computeIsTemperingTargetByLine(glassInfos, taskList, Boolean.TRUE) && computeIsTemperingTargetByLine(glassInfos, taskList, Boolean.FALSE); |
| | | return computeIsTemperingTargetByLine(glassInfos, taskList, line); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param glassInfos 当条线卧转立所有玻璃 |
| | | * @param taskList 当条线卧转立所有任务 |
| | | * @param isTempering true 钢化 false 不钢化 |
| | | * @param line 任务是哪条线 |
| | | */ |
| | | private boolean computeIsTemperingTargetByLine(List<GlassInfo> glassInfos, List<BigStorageCageFeedTask> taskList, Boolean isTempering) { |
| | | private boolean computeIsTemperingTargetByLine(List<GlassInfo> glassInfos, List<BigStorageCageFeedTask> taskList, Integer line) { |
| | | //1、将玻璃信息集合转为glassid为key的map |
| | | Map<String, GlassInfo> glassInfoMap = glassInfos.stream() |
| | | .collect(Collectors.toMap(GlassInfo::getGlassId, p -> p)); |
| | |
| | | .eq(BigStorageCage::getSlot, bigStorageDTO.getSlot())); |
| | | //4、更新进片任务表,目标格子及状态(状态改为2 电气扫到自行处理) 遇到问题:无法批量更新,批量更新无法走指定从库 |
| | | e.setTargetSlot(bigStorageDTO.getSlot()); |
| | | e.setTaskType(Const.BIG_STORAGE_IN_RUN); |
| | | // e.setTaskType(Const.BIG_STORAGE_IN_RUN); |
| | | bigStorageCageFeedTaskService.updateById(e); |
| | | |
| | | //5、将进片信息存入大理片笼详情表 |
| | |
| | | cageDetails.setState(Const.GLASS_STATE_IN); |
| | | bigStorageCageDetailsService.save(cageDetails); |
| | | } |
| | | sendTaskListToPLC(taskList, line); |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | private void sendTaskListToPLC(List<BigStorageCageFeedTask> taskList, Integer line) { |
| | | S7control s7control = S7object.getinstance().plccontrol; |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | String mesD03Address = plcMesObject.getPlcParameter("MESToD03").getAddress(); |
| | | String mesD05Address = plcMesObject.getPlcParameter("MESToD05").getAddress(); |
| | | String outLine = line.equals(Const.A09_OUT_TARGET_POSITION) ? mesD03Address : mesD05Address; |
| | | for (int i = 1; i <= taskList.size(); i++) { |
| | | s7control.writeWord(plcMesObject.getPlcParameter("StartAddToImport" + i).getAddress(), (short) taskList.get(i - 1).getLine()); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("TargetAddToImport" + i).getAddress(), (short) taskList.get(i - 1).getTargetSlot()); |
| | | } |
| | | s7control.writeWord(outLine, (short) 1); |
| | | } |
| | | |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list) { |
| | |
| | | if (bigStorageCageOutTaskList.size() > carMaxSize || e.getWidth() > remainWidth) { |
| | | break; |
| | | } |
| | | remainWidth = remainWidth - e.getWidth().intValue() - galssGap; |
| | | remainWidth = remainWidth - (int) e.getWidth() - galssGap; |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.A09_OUT_TARGET_POSITION, |
| | | e.getWidth().intValue(), 0, 0, 1)); |
| | | (int) e.getWidth(), 0, 0, 1)); |
| | | } |
| | | Assert.isFalse(CollectionUtils.isEmpty(bigStorageCageOutTaskList), "未获取出片数据,结束出片任务"); |
| | | log.info("获取出片任务数据{}条,执行保存", bigStorageCageOutTaskList.size()); |
| | |
| | | bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, slotWidth) |
| | | .in(BigStorageCage::getSlot, slotList)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public Boolean computeIsRun(int line, String glassId) { |
| | | //获取卧转立剩余宽度 |
| | | BigStorageDTO sitToUpRemainWidth = bigStorageCageFeedTaskService.querySitToUpRemainWidth(line); |
| | | //获取玻璃信息 |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | return sitToUpRemainWidth.getWidth() < glassInfo.getWidth(); |
| | | } |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @ApiOperation("出片任务删除") |
| | | @PostMapping("/deleteTemperingGlassInfo") |
| | | public Result deleteTemperingGlassInfo(TemperingGlassInfo temperingGlassInfo) { |
| | | public Result deleteTemperingGlassInfo(@RequestBody TemperingGlassInfo temperingGlassInfo) { |
| | | temperingGlassInfoService.removeById(temperingGlassInfo.getId()); |
| | | return Result.build(200,"删除成功",1); |
| | | } |
| | | |
| | | @ApiOperation("出片任务破损0/拿走1") |
| | | @PostMapping("/damageTemperingGlassInfo") |
| | | public Result damageTemperingGlassInfo(TemperingGlassInfo temperingGlassInfo,int status) { |
| | | public Result damageTemperingGlassInfo(@RequestBody TemperingGlassInfo temperingGlassInfo,int status) { |
| | | bigStorageCageDetailsService.damageBigStorageCageDetails(temperingGlassInfo.getGlassId(),status); |
| | | return Result.build(200,"破损成功",1); |
| | | } |
| | |
| | | { |
| | | "plcAddressBegin":"DB14.0", |
| | | "plcAddressLenght":"84", |
| | | "plcAddressLenght": "938", |
| | | "dataType":"word", |
| | | "parameteInfor":[ |
| | | { |
| | | "codeId": "D01Request", |
| | | "parameteInfor": [{ |
| | | "codeId": "D01ID", |
| | | "addressIndex":"0", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "D01ID1", |
| | | "addressIndex":"2", |
| | | "addressLenght":"6", |
| | | "addressLenght": "32", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D04Request", |
| | | "addressIndex":"34", |
| | | "codeId": "D02ID", |
| | | "addressIndex": "32", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID1", |
| | | "addressIndex": "64", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID2", |
| | | "addressIndex": "96", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID3", |
| | | "addressIndex": "128", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID4", |
| | | "addressIndex": "160", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID5", |
| | | "addressIndex": "192", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID6", |
| | | "addressIndex": "224", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D04ID", |
| | | "addressIndex": "256", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID1", |
| | | "addressIndex": "288", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID2", |
| | | "addressIndex": "328", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID3", |
| | | "addressIndex": "352", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID4", |
| | | "addressIndex": "384", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID5", |
| | | "addressIndex": "416", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID6", |
| | | "addressIndex": "448", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID1", |
| | | "addressIndex": "480", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID2", |
| | | "addressIndex": "512", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID3", |
| | | "addressIndex": "544", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID4", |
| | | "addressIndex": "576", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID5", |
| | | "addressIndex": "608", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID6", |
| | | "addressIndex": "640", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID1", |
| | | "addressIndex": "672", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID2", |
| | | "addressIndex": "704", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID3", |
| | | "addressIndex": "736", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID4", |
| | | "addressIndex": "768", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID5", |
| | | "addressIndex": "800", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID6", |
| | | "addressIndex": "832", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToD03", |
| | | "addressIndex": "888", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D04ID1", |
| | | "addressIndex":"10", |
| | | "addressLenght":"36", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "E01Status", |
| | | "addressIndex":"2", |
| | | "addressLenght":"68", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "E02Status", |
| | | "addressIndex":"2", |
| | | "addressLenght":"70", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "MaxTaskNo", |
| | | "addressIndex":"2", |
| | | "addressLenght":"72", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D02MaxWidth", |
| | | "addressIndex":"2", |
| | | "addressLenght":"74", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D05MaxWidth", |
| | | "addressIndex":"2", |
| | | "addressLenght":"76", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "GlassGap", |
| | | "addressIndex":"2", |
| | | "addressLenght":"78", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D02SitState", |
| | | "addressIndex":"80", |
| | | "codeId": "MESToD05", |
| | | "addressIndex": "890", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D05SitState", |
| | | "addressIndex":"82", |
| | | "codeId": "MESToPLC", |
| | | "addressIndex": "892", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport1", |
| | | "addressIndex": "914", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport2", |
| | | "addressIndex": "916", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport3", |
| | | "addressIndex": "918", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport4", |
| | | "addressIndex": "920", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport5", |
| | | "addressIndex": "922", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport6", |
| | | "addressIndex": "924", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport1", |
| | | "addressIndex": "926", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport2", |
| | | "addressIndex": "928", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport3", |
| | | "addressIndex": "930", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport4", |
| | | "addressIndex": "932", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport5", |
| | | "addressIndex": "934", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport6", |
| | | "addressIndex": "936", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "deviceState", |
| | | "addressIndex": "864", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01State", |
| | | "addressIndex": "866", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02State", |
| | | "addressIndex": "868", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03State", |
| | | "addressIndex": "870", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05State", |
| | | "addressIndex": "872", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.job.PlcStorageCageTask; |
| | |
| | | BigStorageCageService bigStorageCageService; |
| | | @Autowired |
| | | PlcStorageCageTask plcStorageCageTask; |
| | | @Autowired |
| | | BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | |
| | | log.info("获取大理片笼信息:{}", bigStorageCageService.selectBigStorageCageUsage()); |
| | | } |
| | | |
| | | @Test |
| | | public void selectBigStorageCageDetails() { |
| | | log.info("获取大理片笼信息:{}", bigStorageCageDetailsService.selectBigStorageCageDetails("P24060403|3|6")); |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * 平均利用率 |
| | | */ |
| | | private Double avgAvailability; |
| | | private double avgAvailability; |
| | | |
| | | /** |
| | | * 有效利用率 |
| | | */ |
| | | private Double validAvailability; |
| | | private double validAvailability; |
| | | |
| | | /** |
| | | * 尾片利用率 |
| | | */ |
| | | private Double lastAvailability; |
| | | private double lastAvailability; |
| | | |
| | | /** |
| | | * 状态 |
| | |
| | | /** |
| | | * 小片总面积 |
| | | */ |
| | | private Double glassTotalArea; |
| | | private double glassTotalArea; |
| | | |
| | | /** |
| | | * 计划原片总数 |
| | |
| | | /** |
| | | * 计划原片总面积 |
| | | */ |
| | | private Double planPatternTotalArea; |
| | | private double planPatternTotalArea; |
| | | |
| | | /** |
| | | * 实际原片总数 |
| | |
| | | /** |
| | | * 实际原片总面积 |
| | | */ |
| | | private Double realityPatternTotalArea; |
| | | private double realityPatternTotalArea; |
| | | |
| | | /** |
| | | * 膜系id |
| | |
| | | /** |
| | | * 平均利用率 |
| | | */ |
| | | private Double avgCutPct; |
| | | private double avgCutPct; |
| | | |
| | | /** |
| | | * 有效利用率 |
| | | */ |
| | | private Double validCutPct; |
| | | private double validCutPct; |
| | | |
| | | /** |
| | | * 尾片利用率 |
| | | */ |
| | | private Double lastCutPct; |
| | | private double lastCutPct; |
| | | |
| | | /** |
| | | * 状态 |
| | |
| | | /** |
| | | * 小片总面积 |
| | | */ |
| | | private Double glassTotalArea; |
| | | private double glassTotalArea; |
| | | /** |
| | | * 计划原片总数 |
| | | */ |
| | |
| | | /** |
| | | * 计划原片总面积 |
| | | */ |
| | | private Double rawStockArea; |
| | | private double rawStockArea; |
| | | /** |
| | | * 实际原片总数 |
| | | */ |
| | |
| | | /** |
| | | * 实际原片总面积 |
| | | */ |
| | | private Double actualStockArea; |
| | | private double actualStockArea; |
| | | /** |
| | | * 膜系 |
| | | */ |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double glassThickness; |
| | | private double glassThickness; |
| | | |
| | | /** |
| | | * 原片版图片序 |
| | |
| | | /** |
| | | * 原片宽 |
| | | */ |
| | | private Double patternWidth; |
| | | private double patternWidth; |
| | | |
| | | /** |
| | | * 原片高 |
| | | */ |
| | | private Double patternHeight; |
| | | private double patternHeight; |
| | | |
| | | /** |
| | | * 原片厚度 |
| | | */ |
| | | private Double patternThickness; |
| | | private double patternThickness; |
| | | |
| | | /** |
| | | * 膜系 |
| | |
| | | <version>2.8.9</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.microsoft.sqlserver</groupId> |
| | | <artifactId>sqljdbc4</artifactId> |
| | | <version>4.0</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <properties> |
| | |
| | | package com.mes; |
| | | |
| | | //import com.mes.common.S7object; |
| | | import com.mes.common.S7object; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | log.info("启动完成"); |
| | | //S7object.getinstance().start(); |
| | | S7object.getinstance().start(); |
| | | |
| | | } |
| | | } |
| | |
| | | public class S7object extends Thread { |
| | | public S7control plccontrol; // PLC通讯类实例 |
| | | private EPlcType plcType = EPlcType.S1200; // 西门子PLC类型 |
| | | private String ip = "192.168.10.1"; // plc ip地址 |
| | | private String ip = "192.168.30.100"; // plc ip地址 |
| | | private int port = 102; // plc 端口号 |
| | | |
| | | |
| | |
| | | package com.mes.downglassinfo.controller; |
| | | |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | @RequestMapping("/downGlassTask") |
| | | public class DownGlassTaskController { |
| | | |
| | | @Autowired |
| | | DownGlassInfoService downGlassInfoService; |
| | | |
| | | @PostMapping("/generateOutGlassTask") |
| | | @ApiOperation(value = "生成出片任务", notes = "生成出片任务") |
| | | public Result<Boolean> generateOutGlassTask(@RequestBody String glassId) { |
| | | return Result.success(downGlassInfoService.generateOutGlassTask(glassId)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.mes.downglassinfo.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.data.annotation.Id; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | /** |
| | | * 下片玻璃信息表id |
| | | */ |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 流程卡号 |
| | | */ |
| | | private String flowCardId; |
| | | |
| | | /** |
| | | * 层号 |
| | | */ |
| | | private Integer layer; |
| | | |
| | | /** |
| | | * 顺序 |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double thickness; |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 膜系 |
| | |
| | | package com.mes.downglassinfo.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | |
| | | /** |
| | | * id |
| | | */ |
| | | @TableId(value = "id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | private String glassId; |
| | | |
| | | |
| | | /** |
| | | * 起始 |
| | | */ |
| | | private String startCell; |
| | | private Integer startCell; |
| | | |
| | | /** |
| | | * 目标 |
| | | */ |
| | | private String endCell; |
| | | private Integer endCell; |
| | | |
| | | /** |
| | | * 任务类型 1:进 2:出 |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private Integer width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private Integer height; |
| | | |
| | | /** |
| | | * 膜系 |
| | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double thickness; |
| | | private Integer thickness; |
| | | |
| | | /** |
| | | * 流程卡号 |
| | | */ |
| | | private String flowCardId; |
| | | /** |
| | | * 层号 |
| | | */ |
| | | private int layer; |
| | | |
| | | /** |
| | | * 任务状态 0 未开始 1正在进行 2完成 |
| | | */ |
| | | private Integer taskStauts; |
| | | |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | private String glassId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | |
| | | package com.mes.downglassinfo.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.downworkstation.entity.dto.DownGlassInfoDTO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Repository |
| | | public interface DownGlassInfoMapper extends BaseMapper<DownGlassInfo>, MPJBaseMapper<DownGlassInfo> { |
| | | public interface DownGlassInfoMapper extends BaseMapper<DownGlassInfo> { |
| | | |
| | | |
| | | DownGlassInfoDTO queryDownGlassMaxLayer(@Param(value = "flowCardId") String flowCardId); |
| | | |
| | | Integer queryMaxSequence(@Param(value = "flowCardId") String flowCardId, @Param(value = "layer") int layer); |
| | | |
| | | List<DownGlassInfoDTO> queryWorkStationIsIn(@Param(value = "isDownload") Boolean isDownload); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downworkstation.entity.dto.DownGlassInfoDTO; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface DownGlassInfoService extends IService<DownGlassInfo> { |
| | | |
| | |
| | | * @param flowCardId |
| | | * @return // 根据流程卡号查询最大序号 |
| | | */ |
| | | Integer getMaxSequenceByFlowCardId(String flowCardId); |
| | | Integer getMaxSequenceByFlowCardId(String flowCardId, int layer); |
| | | |
| | | /** |
| | | * @param downGlassInfo 插入下片信息 |
| | |
| | | void insertDownGlassInfo(DownGlassInfo downGlassInfo); |
| | | |
| | | |
| | | DownGlassInfoDTO queryDownGlassMaxLayer(String flowCardId); |
| | | |
| | | Integer queryMaxSequence(String flowCardId, int layer); |
| | | |
| | | /** |
| | | * 获取架子绑定 流程卡的玻璃信息(已落架/未落架) |
| | | * |
| | | * @param isDownload true/false |
| | | * @return |
| | | */ |
| | | List<DownGlassInfoDTO> queryWorkStationIsIn(Boolean isDownload); |
| | | |
| | | /** |
| | | * 生成出片任务 |
| | | * |
| | | * @param glassId |
| | | * @return |
| | | */ |
| | | boolean generateOutGlassTask(String glassId); |
| | | } |
| | |
| | | package com.mes.downglassinfo.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.mapper.DownGlassInfoMapper; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import com.mes.downworkstation.entity.dto.DownGlassInfoDTO; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.job.DownLoadCacheGlassTask; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class DownGlassInfoServiceImpl extends ServiceImpl<DownGlassInfoMapper, DownGlassInfo> implements DownGlassInfoService { |
| | | |
| | | // 根据流程卡号查询最大序号 |
| | | @Autowired |
| | | DownLoadCacheGlassTask downLoadCacheGlassTask; |
| | | |
| | | @Autowired |
| | | DownStorageCageDetailsService downStorageCageDetailsService; |
| | | |
| | | /** |
| | | * 根据流程卡号查询最大序号 |
| | | */ |
| | | @Override |
| | | public Integer getMaxSequenceByFlowCardId(String flowCardId) { |
| | | public Integer getMaxSequenceByFlowCardId(String flowCardId, int layer) { |
| | | LambdaQueryWrapper<DownGlassInfo> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
| | | lambdaQueryWrapper.eq(DownGlassInfo::getFlowCardId, flowCardId) |
| | | .eq(DownGlassInfo::getLayer, flowCardId) |
| | | .select(DownGlassInfo::getSequence) |
| | | .orderByDesc(DownGlassInfo::getSequence) |
| | | .last("LIMIT 1"); |
| | |
| | | return downGlassInfo != null ? downGlassInfo.getSequence() : 0; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void insertDownGlassInfo(DownGlassInfo downGlassInfo) { |
| | | |
| | | |
| | | |
| | | baseMapper.insert(downGlassInfo); |
| | | } |
| | | |
| | | @Override |
| | | public DownGlassInfoDTO queryDownGlassMaxLayer(String flowCardId) { |
| | | return baseMapper.queryDownGlassMaxLayer(flowCardId); |
| | | } |
| | | |
| | | @Override |
| | | public Integer queryMaxSequence(String flowCardId, int layer) { |
| | | return baseMapper.queryMaxSequence(flowCardId, layer); |
| | | } |
| | | |
| | | @Override |
| | | public List<DownGlassInfoDTO> queryWorkStationIsIn(Boolean isDownload) { |
| | | return baseMapper.queryWorkStationIsIn(isDownload); |
| | | } |
| | | |
| | | @Override |
| | | public boolean generateOutGlassTask(String glassId) { |
| | | //更新卧式理片笼内玻璃状态 |
| | | downStorageCageDetailsService.update(new LambdaUpdateWrapper<DownStorageCageDetails>() |
| | | .set(DownStorageCageDetails::getState, Const.GLASS_STATE_OUT).eq(DownStorageCageDetails::getGlassId, glassId)); |
| | | DownStorageCageDetails details = downStorageCageDetailsService.getOne(new LambdaQueryWrapper<DownStorageCageDetails>() |
| | | .eq(DownStorageCageDetails::getGlassId, glassId)); |
| | | //生成下片信息 |
| | | DownGlassInfo downGlassInfo = new DownGlassInfo(); |
| | | BeanUtils.copyProperties(details, downGlassInfo); |
| | | //获取当前流程卡最大片序 |
| | | downGlassInfo.setSequence(this.getMaxSequenceByFlowCardId(details.getFlowCardId(), details.getLayer()) + 1); |
| | | this.save(downGlassInfo); |
| | | //生成任务信息 并向plc发送出片任务 |
| | | GlassInfo glassInfo = new GlassInfo(); |
| | | BeanUtils.copyProperties(details, glassInfo); |
| | | return downLoadCacheGlassTask.initDownGlassTask(glassInfo, details.getSlot(), 3001, 2); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double thickness; |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 钢化版图id |
| | |
| | | * 玻璃间隙 |
| | | */ |
| | | private Integer gap; |
| | | /** |
| | | * 总层数 |
| | | */ |
| | | private Integer totalLayer; |
| | | /** |
| | | * 层数 |
| | | */ |
| | | private Integer layer; |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.downstorage.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import org.apache.ibatis.annotations.*; |
| | | |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Mapper |
| | | public interface DownStorageCageDetailsMapper extends MPJBaseMapper<DownStorageCageDetails> { |
| | | |
| | | DownStorageCageDetails getGlassInfoMaxCount(); |
| | | } |
| | |
| | | // * @return 直通查询 |
| | | // */ |
| | | // List<GlassInfo> DirectConnection(); |
| | | |
| | | /** |
| | | * @return 直通查询 |
| | | */ |
| | | boolean DirectConnection(GlassInfo glassInfo); |
| | | |
| | | DownStorageCageDetails getGlassInfoMaxCount(); |
| | | |
| | | /** |
| | | * @param glassId |
| | | * @param ControlsId |
| | |
| | | package com.mes.downstorage.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | |
| | | */ |
| | | public interface DownStorageCageService extends MPJBaseService<DownStorageCage> { |
| | | |
| | | DownGlassTask createDownGlassTask(GlassInfo glassInfo, String startCell, String endCell, String taskType); |
| | | DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, String startCell, String endCell, String taskType); |
| | | DownGlassTask createDownGlassTask(GlassInfo glassInfo, Integer startCell, Integer endCell, String taskType); |
| | | |
| | | DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, Integer startCell, Integer endCell, String taskType); |
| | | // List<Map<String, Object>> selectCacheLeisure(); |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * @return 找到空格子 |
| | | */ |
| | | DownStorageCage selectCacheEmpty(int currentSlot, boolean flag); |
| | | |
| | | /** |
| | | * @return 找到空格子 |
| | |
| | | return count > 0; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public DownStorageCageDetails getGlassInfoMaxCount() { |
| | | return baseMapper.getGlassInfoMaxCount(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | |
| | | package com.mes.downstorage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | |
| | | //import com.mes.device.PlcParameterObject; |
| | | import com.google.common.base.Functions; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.mapper.DownStorageCageDetailsMapper; |
| | | import com.mes.downstorage.mapper.DownStorageCageMapper; |
| | |
| | | import com.mes.downstorage.service.DownStorageCageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import net.sf.jsqlparser.statement.select.SelectItem; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private DownStorageCageDetailsMapper downStorageCageDetailsMapper; |
| | | |
| | | @Override |
| | | public DownGlassTask createDownGlassTask(GlassInfo glassInfo, String startCell, String endCell, String taskType) { |
| | | public DownGlassTask createDownGlassTask(GlassInfo glassInfo, Integer startCell, Integer endCell, String taskType) { |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | |
| | | BeanUtils.copyProperties(glassInfo, downGlassTask); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, String startCell, String endCell, String taskType) { |
| | | public DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, Integer startCell, Integer endCell, String taskType) { |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | |
| | | BeanUtils.copyProperties(glassInfo, downGlassTask); |
| | |
| | | downGlassTask.setEndCell(endCell); |
| | | return downGlassTask; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //找到空格子 |
| | | @Override |
| | | public List<DownStorageCageDetails> selectCacheEmpty() { |
| | | return baseMapper.selectJoinList(DownStorageCageDetails.class, |
| | | return this.selectJoinList(DownStorageCageDetails.class, |
| | | JoinWrappers.lambda(DownStorageCage.class) |
| | | .selectAll(DownStorageCage.class) |
| | | .select(DownStorageCageDetails::getWidth, DownStorageCageDetails::getHeight, DownStorageCageDetails::getGlassId) |
| | | .leftJoin(DownStorageCageDetails.class, on -> on |
| | | .eq(DownStorageCageDetails::getDeviceId, DownStorageCage::getDeviceId) |
| | | .eq(DownStorageCageDetails::getSlot, DownStorageCage::getSlot) |
| | | .eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | ) |
| | | .eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN)) |
| | | .isNull(DownStorageCageDetails::getSlot) |
| | | ); |
| | | } |
| | | |
| | | //找到空格子 |
| | | @Override |
| | | public DownStorageCage selectCacheEmpty(int currentSlot, boolean flag) { |
| | | List<DownStorageCage> emptyList = this.selectJoinList(DownStorageCage.class, |
| | | JoinWrappers.lambda(DownStorageCage.class) |
| | | .selectAll(DownStorageCage.class) |
| | | .leftJoin(DownStorageCageDetails.class, on -> on |
| | | .eq(DownStorageCageDetails::getSlot, DownStorageCage::getSlot) |
| | | .eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN)) |
| | | .isNull(DownStorageCageDetails::getSlot) |
| | | .last("order by abs(t.slot - " + currentSlot + ") asc limit 2") |
| | | ); |
| | | if (flag && CollectionUtil.isNotEmpty(emptyList)) { |
| | | return emptyList.get(0); |
| | | } |
| | | if (CollectionUtil.isEmpty(emptyList) || emptyList.size() == 1) { |
| | | return null; |
| | | } |
| | | return emptyList.get(0); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | */ |
| | | private Integer workState; |
| | | |
| | | /** |
| | | * 层数 |
| | | */ |
| | | private Integer layer; |
| | | |
| | | |
| | | /** |
| | | * 总数量 |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 膜系 |
| | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double thickness; |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 流程卡号 |
| | |
| | | import lombok.Data;
|
| | | import lombok.EqualsAndHashCode;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | /**
|
| | | * <p>
|
| | | *
|
| | |
| | | /**
|
| | | * 宽
|
| | | */
|
| | | private Double width;
|
| | | private double width;
|
| | |
|
| | | /**
|
| | | * 高
|
| | | */
|
| | | private Double height;
|
| | | private Double totalwidth;
|
| | | private double height;
|
| | | private double totalwidth;
|
| | |
|
| | | private Double totalheight;
|
| | | private double totalheight;
|
| | | /**
|
| | | * 厚度
|
| | | */
|
| | | private Double thickness;
|
| | | private double thickness;
|
| | |
|
| | |
|
| | | private String Filmsid;
|
New file |
| | |
| | | package com.mes.downworkstation.entity.dto; |
| | | |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/6/21 16:06 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class DownGlassInfoDTO { |
| | | /** |
| | | * 流程卡号 |
| | | */ |
| | | private String flowCardId; |
| | | /** |
| | | * 层数 |
| | | */ |
| | | private Integer layer; |
| | | /** |
| | | * 落架数量 |
| | | */ |
| | | private Integer count; |
| | | |
| | | /** |
| | | * 流程卡未进片的玻璃信息 |
| | | */ |
| | | private List<GlassInfo> glassInfoList; |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | |
| | | // @Value("${mes.threshold}") |
| | | private int threshold; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void autoBindRack() { |
| | | log.info("根据缓存中已经进片的玻璃种数量最多的流程卡号自动绑定一个启用状态的空架子"); |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | log.info("3、如果当前玻璃属于流程卡中的片序的顺序则直通,执行下片任务"); |
| | | DownWorkstation downWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>().eq(DownWorkstation::getFlowCardId, glassInfo.getFlowCardId())); |
| | | int WorkstationId = downWorkstation.getWorkstationId(); |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(glassInfo, "0", String.valueOf(WorkstationId), "3"); |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(glassInfo, 0, WorkstationId, "3"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | |
| | | } else { |
| | |
| | | downStorageCageDetailsService.save(details); |
| | | log.info("7、玻璃信息已存入理片笼详情表,玻璃信息为{}", details); |
| | | |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(glassInfo, "0", item.getSlot() + "", "1"); |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(glassInfo, 0, item.getSlot(), "1"); |
| | | //添加进片任务 |
| | | log.info("8、生成进片任务信息存入任务表{}", downGlassTask); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | |
| | | |
| | | DownStorageCageDetails selectedItem = null; |
| | | |
| | | String endCell = ""; |
| | | Integer endCell = null; |
| | | |
| | | // 优先 超出尺寸优先人工出片 人工处理 |
| | | if (!list1to6.isEmpty()) { |
| | |
| | | new LambdaQueryWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getFlowCardId, selectedItem.getFlowCardId()) |
| | | ); |
| | | endCell = String.valueOf(downWorkstation.getWorkstationId()); |
| | | if (endCell.isEmpty()) { |
| | | endCell = "7"; |
| | | endCell = downWorkstation.getWorkstationId(); |
| | | if (endCell == null) { |
| | | endCell = 7; |
| | | } |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(selectedItem, "9", endCell, "2"); |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(selectedItem, 9, endCell, "2"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | LambdaQueryWrapper<DownStorageCageDetails> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(DownStorageCageDetails::getGlassId, selectedItem.getGlassId()); |
| | |
| | | // 创建新的 DownGlassInfo 对象并设置相关属性 |
| | | DownGlassInfo newdownGlassInfo = new DownGlassInfo(); |
| | | |
| | | Integer maxSequence = downGlassInfoService.getMaxSequenceByFlowCardId(downGlassInfo.getFlowCardId()); |
| | | Integer maxSequence = downGlassInfoService.getMaxSequenceByFlowCardId(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | // 初始化顺序字段值 |
| | | int sequence = maxSequence != null ? maxSequence + 1 : 1; |
| | | BeanUtils.copyProperties(downGlassInfo, newdownGlassInfo); |
New file |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.core.lang.Assert; |
| | | import cn.smallbun.screw.core.util.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import com.mes.downstorage.service.DownStorageCageService; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.dto.DownGlassInfoDTO; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.tools.S7control; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/5/8 8:17 |
| | | * @Description: |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class DownLoadCacheGlassTask { |
| | | |
| | | @Autowired |
| | | DownGlassTaskService downGlassTaskService; |
| | | @Autowired |
| | | GlassInfoService glassInfoService; |
| | | @Autowired |
| | | DownStorageCageDetailsService downStorageCageDetailsService; |
| | | @Autowired |
| | | DownStorageCageService downStorageCageService; |
| | | @Autowired |
| | | DownWorkstationService downWorkstationService; |
| | | @Autowired |
| | | DownGlassInfoService downGlassInfoService; |
| | | |
| | | @Value("${mes.threshold}") |
| | | private Integer threshold; |
| | | |
| | | @Value("${mes.throughWidth}") |
| | | private Integer throughWidth; |
| | | |
| | | @Value("${mes.throughHeight}") |
| | | private Integer throughHeight; |
| | | |
| | | @Value("${mes.maxWidth}") |
| | | private Integer maxWidth; |
| | | |
| | | @Value("${mes.maxHeight}") |
| | | private Integer maxHeight; |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void plcHomeEdgTask() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String requestWord = plcParameterObject.getPlcParameter("requestWord").getValue(); |
| | | String glassIdeValue = plcParameterObject.getPlcParameter("requestID").getValue(); |
| | | //A08 A09表示线路相同 可做等价 无数据转int异常 |
| | | String out06Glassstate = plcParameterObject.getPlcParameter("glassStatus06").getValue(); |
| | | String out08Glassstate = plcParameterObject.getPlcParameter("glassStatus08").getValue(); |
| | | String out11Glassstate = plcParameterObject.getPlcParameter("glassStatus11").getValue(); |
| | | String out13Glassstate = plcParameterObject.getPlcParameter("glassStatus13").getValue(); |
| | | String confirmationWrodValue = plcParameterObject.getPlcParameter("confirmationWord").getValue(); |
| | | String confirmationWrodAddress = plcParameterObject.getPlcParameter("confirmationWord").getAddress(); |
| | | String currentSlot = plcParameterObject.getPlcParameter("currentCell").getValue(); |
| | | |
| | | log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态分别为:g06:{}、g08:{}、g11:{}、g13:{},当前格子号为:{}", |
| | | requestWord, glassIdeValue, confirmationWrodValue, out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, currentSlot); |
| | | |
| | | if ("0".equals(requestWord)) { |
| | | if ("0".equals(confirmationWrodValue)) { |
| | | log.info("2、获取到的请求字为0,且确认字为0,不执行任务"); |
| | | return; |
| | | } |
| | | log.info("2、获取到的请求字为0,将确认字改为0"); |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, (short) 0); |
| | | return; |
| | | } |
| | | if (!"0".equals(confirmationWrodValue)) { |
| | | log.info("2、获取到的请求字不为0,将确认字不为0,直接结束"); |
| | | return; |
| | | } |
| | | if ("1".equals(requestWord)) { |
| | | log.info("2、进片请求,且确认字为0,执行进片任务"); |
| | | inTo(glassIdeValue, requestWord, currentSlot); |
| | | } else if ("2".equals(requestWord)) { |
| | | //09空闲 :1 10空闲 :2 都空闲:3 其他0 |
| | | log.info("2、出片请求,且确认字为0,执行进片任务"); |
| | | outTo(out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, glassIdeValue, currentSlot); |
| | | } else if ("3".equals(requestWord)) { |
| | | log.info("2、进片和出片都空闲,执行出片任务"); |
| | | //加笼子里面是否有玻璃,有先出,无玻璃先进 |
| | | boolean outFlase = outTo(out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, glassIdeValue, currentSlot); |
| | | log.info("出片任务是否完成:{},失败且玻璃id:{}不为空则执行进片任务", outFlase, glassIdeValue); |
| | | if (!outFlase && StringUtils.isNotBlank(glassIdeValue)) { |
| | | inTo(glassIdeValue, requestWord, currentSlot); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void inTo(String glassId, String requestWord, String currentSlot) { |
| | | log.info("1、按照玻璃id:{}获取玻璃小片信息,当前格子为:{}", glassId, currentSlot); |
| | | //添加进片任务 查找空格 |
| | | DownStorageCage nearestEmpty = downStorageCageService.selectCacheEmpty(Integer.parseInt(currentSlot), Boolean.FALSE); |
| | | Assert.isTrue(null != nearestEmpty, "格子已满,无法执行进片操作"); |
| | | log.info("2、查询卧式理片笼里面的空格:{}", nearestEmpty); |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | Assert.isFalse(null == glassInfo, "玻璃信息不存在"); |
| | | if ("1".equals(requestWord) && (glassInfo.getWidth() > throughWidth || glassInfo.getHeight() > throughHeight)) { |
| | | log.info("玻璃当前尺寸宽:{},高:{}只能直通,当前进片任务需等待", glassInfo.getWidth(), glassInfo.getHeight()); |
| | | return; |
| | | } |
| | | Boolean checkFlag = Boolean.FALSE; |
| | | //玻璃尺寸是否走人工下片 |
| | | if (glassInfo.getWidth() > maxWidth || glassInfo.getHeight() > maxHeight) { |
| | | log.info("该玻璃尺寸走人工下片,直接进片"); |
| | | } else { |
| | | log.info("该玻璃尺寸非人工下片"); |
| | | //获取该玻璃的流程卡是否已绑定架子 |
| | | DownWorkstation one = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getLayer, glassInfo.getLayer()) |
| | | .eq(DownWorkstation::getFlowCardId, glassInfo.getFlowCardId())); |
| | | Boolean isBind = Boolean.FALSE; |
| | | if (null != one) { |
| | | log.info("该流程卡已绑定架子"); |
| | | isBind = Boolean.TRUE; |
| | | checkFlag = multilayerCheck(glassInfo, isBind); |
| | | } |
| | | if (!checkFlag && !isBind) { |
| | | log.info("该玻璃的流程卡未绑定架子,获取是否有空架子"); |
| | | List<DownWorkstation> list = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .isNull(DownWorkstation::getFlowCardId)); |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | log.info("有空架子,将流程卡与架子好绑定,执行进片任务 结束"); |
| | | //绑定流程卡 |
| | | downWorkstationService.update(new LambdaUpdateWrapper<DownWorkstation>() |
| | | .set(DownWorkstation::getFlowCardId, glassInfo.getFlowCardId()) |
| | | .set(DownWorkstation::getLayer, glassInfo.getLayer()) |
| | | .eq(DownWorkstation::getWorkstationId, list.get(0).getWorkstationId())); |
| | | checkFlag = Boolean.TRUE; |
| | | } |
| | | } |
| | | if (!checkFlag) { |
| | | log.info("无空架子,获取已绑定架子的流程卡信息,查看玻璃信息是否可被对调"); |
| | | List<DownGlassInfoDTO> downGlassInfoDTOList = downGlassInfoService.queryWorkStationIsIn(Boolean.FALSE); |
| | | log.info("获取架子上已绑定流程卡落架的数量及未落架的玻璃数据:{}", downGlassInfoDTOList); |
| | | if (CollectionUtils.isNotEmpty(downGlassInfoDTOList)) { |
| | | log.info("已绑定流程卡均无未落架玻璃,请及时处理架子上的玻璃,清除流程卡,执行进片任务"); |
| | | } else { |
| | | //替换玻璃信息 |
| | | endLoop: |
| | | for (DownGlassInfoDTO e : downGlassInfoDTOList) { |
| | | List<GlassInfo> glassInfoList = e.getGlassInfoList(); |
| | | for (GlassInfo item : glassInfoList) { |
| | | if (item.getWidth() == glassInfo.getWidth() && item.getHeight() == glassInfo.getHeight() |
| | | && item.getThickness() == glassInfo.getThickness() && item.getFilmsid().equals(glassInfo.getFilmsid())) { |
| | | //玻璃是否为多层 |
| | | checkFlag = multilayerCheck(item, Boolean.FALSE); |
| | | if (checkFlag) { |
| | | //玻璃替换 仅替换流程卡id及层数 |
| | | String tempFlowCardId = item.getFlowCardId(); |
| | | Integer tempLayer = item.getLayer(); |
| | | String flowCardId = glassInfo.getFlowCardId(); |
| | | Integer layer = glassInfo.getLayer(); |
| | | log.info("替换流程卡信息,当前玻璃信息:{}的流程卡号{}及层数{},替换后玻璃信息:{}的流程卡号{}及层数{}", |
| | | item, glassInfo, flowCardId, layer, tempFlowCardId, tempLayer); |
| | | glassInfo.setFlowCardId(tempFlowCardId); |
| | | glassInfo.setLayer(tempLayer); |
| | | glassInfoService.updateById(glassInfo); |
| | | item.setFlowCardId(flowCardId); |
| | | item.setLayer(layer); |
| | | glassInfoService.updateById(item); |
| | | break endLoop; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //将任务插入理片笼详情表 |
| | | DownStorageCageDetails downStorageCageDetails = new DownStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInfo, downStorageCageDetails); |
| | | downStorageCageDetails.setState(Const.GLASS_STATE_IN); |
| | | downStorageCageDetails.setSlot(nearestEmpty.getSlot()); |
| | | downStorageCageDetailsService.save(downStorageCageDetails); |
| | | // 生成进片任务 |
| | | initDownGlassTask(glassInfo, 0, nearestEmpty.getSlot(), Const.GLASS_CACHE_TYPE_IN); |
| | | } |
| | | |
| | | public Boolean outTo(String glassStatus06, String out08Glassstate, String glassStatus11, String glassStatus13, String glassId, String currentSlot) { |
| | | if ("2".equals(glassStatus06) && "2".equals(glassStatus11) && "2".equals(glassStatus13)) { |
| | | log.info("G06、G11、G13分别为{},{}、{}非自动状态,无法出片", glassStatus06, glassStatus11, glassStatus13); |
| | | return Boolean.FALSE; |
| | | } |
| | | |
| | | List<DownStorageCageDetails> tempList = downStorageCageDetailsService.list(new LambdaQueryWrapper<DownStorageCageDetails>() |
| | | .eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | //获取待进片玻璃 |
| | | DownStorageCageDetails cageDetails = new DownStorageCageDetails(); |
| | | if (StringUtils.isNotBlank(glassId)) { |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | BeanUtils.copyProperties(glassInfo, cageDetails); |
| | | //获取当前笼子空格信息 |
| | | DownStorageCage empty = downStorageCageService.selectCacheEmpty(Integer.parseInt(currentSlot), Boolean.TRUE); |
| | | cageDetails.setSlot(empty.getSlot()); |
| | | tempList.add(cageDetails); |
| | | } |
| | | |
| | | log.info("笼内玻璃的数据有:{}", tempList); |
| | | if (CollectionUtils.isEmpty(tempList)) { |
| | | log.info("笼内没有玻璃,无法执行出片"); |
| | | return Boolean.FALSE; |
| | | } |
| | | Boolean flag08 = "1".equals(out08Glassstate) ? Boolean.TRUE : Boolean.FALSE; |
| | | if (!generateTaskByShelf(glassStatus11, flag08, glassStatus13, tempList, cageDetails)) { |
| | | return generateTaskByShelf(glassStatus11, !flag08, glassStatus13, tempList, cageDetails); |
| | | } |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | private Boolean multilayerCheck(GlassInfo glassInfo, boolean isBind) { |
| | | //查询该流程卡是否为多层 |
| | | if (glassInfo.getTotalLayer() > 1) { |
| | | log.info("按照流程卡获取当前流程卡各层已落架数量"); |
| | | DownGlassInfoDTO downGlassInfoDTO = downGlassInfoService.queryDownGlassMaxLayer(glassInfo.getFlowCardId()); |
| | | if (null == downGlassInfoDTO) { |
| | | if (isBind) { |
| | | return Boolean.TRUE; |
| | | } else { |
| | | log.info("架子已经占满,多层玻璃无法找到对应的格子,需执行替换玻璃的操作"); |
| | | return Boolean.FALSE; |
| | | } |
| | | |
| | | } |
| | | if (downGlassInfoDTO.getLayer().equals(glassInfo.getLayer())) { |
| | | log.info("当前玻璃的流程在架子上落架最多 直接进片"); |
| | | return Boolean.TRUE; |
| | | } |
| | | Integer sequence = downGlassInfoService.queryMaxSequence(glassInfo.getFlowCardId(), glassInfo.getLayer()); |
| | | log.info("获取当前玻璃需要放的次序:笼内同流程 同层数的通达次序+1:{}", sequence); |
| | | DownGlassInfo downGlassInfo = downGlassInfoService.getOne(new LambdaQueryWrapper<DownGlassInfo>() |
| | | .eq(DownGlassInfo::getFlowCardId, downGlassInfoDTO.getFlowCardId()) |
| | | .eq(DownGlassInfo::getLayer, downGlassInfoDTO.getLayer()).eq(DownGlassInfo::getSequence, sequence)); |
| | | log.info("拿当前版序获取玻璃信息{},按照次序判断当前玻璃是否尺寸对应的上(与数量最多的次序比较)。", downGlassInfo); |
| | | if (null != downGlassInfoDTO && downGlassInfo.getWidth() == glassInfo.getWidth() && downGlassInfo.getHeight() == glassInfo.getHeight()) { |
| | | log.info("相同次序玻璃对应上,可执行进片任务"); |
| | | return Boolean.TRUE; |
| | | } else { |
| | | log.info("同次序玻璃对应不上,需执行替换玻璃的操作"); |
| | | return Boolean.FALSE; |
| | | } |
| | | } else { |
| | | log.info("非多层玻璃,直接进片"); |
| | | return Boolean.TRUE; |
| | | } |
| | | } |
| | | |
| | | private Boolean generateTaskByShelf(String glassStatus, Boolean flag08, String glassStatus13, List<DownStorageCageDetails> tempList, DownStorageCageDetails cageDetails) { |
| | | //获取2个机械臂范围内的架子绑定的流程卡信息 |
| | | List<Integer> workList = new ArrayList(); |
| | | |
| | | if (flag08) { |
| | | if (!"2".equals(glassStatus)) { |
| | | workList.addAll(Const.G11_WORK_STATION); |
| | | } |
| | | } else { |
| | | if (!"2".equals(glassStatus)) { |
| | | workList.addAll(Const.G06_WORK_STATION); |
| | | } |
| | | } |
| | | List<DownStorageCageDetails> list = new ArrayList(); |
| | | Boolean isEmptyShelf = Boolean.FALSE; |
| | | //对笼内玻璃进行过滤,仅出符合逻辑的玻璃 |
| | | if (CollectionUtils.isNotEmpty(workList)) { |
| | | List<DownWorkstation> downWorkstationList = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getEnableState, 0).in(DownWorkstation::getWorkstationId, workList)); |
| | | log.info("架子被禁用,无法出片落架"); |
| | | if (CollectionUtils.isEmpty(downWorkstationList)) { |
| | | log.info("笼子被禁用,无法走机械臂下片"); |
| | | //走人工下片 |
| | | if (!"2".equals(glassStatus13)) { |
| | | list = tempList.stream().filter(item -> item.getWidth() > maxWidth || item.getHeight() > maxHeight).collect(Collectors.toList()); |
| | | } |
| | | } else { |
| | | List<DownWorkstation> workstationsIsNotBind = downWorkstationList.stream().filter(item -> null == (item.getFlowCardId())).collect(Collectors.toList()); |
| | | Map<String, List<DownWorkstation>> listMap = downWorkstationList.stream().collect(Collectors.groupingBy(item -> item.getFlowCardId() + ":" + item.getLayer())); |
| | | if (CollectionUtils.isEmpty(workstationsIsNotBind)) { |
| | | log.info("不存在未绑定流程卡架子"); |
| | | //筛选出对应架子已绑定流程卡可下片的玻璃 |
| | | list = tempList.stream().filter(item -> listMap.containsKey(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | } else { |
| | | log.info("存在未绑定流程卡架子,直接获取笼内所有玻璃"); |
| | | isEmptyShelf = Boolean.TRUE; |
| | | //todo:如果禁用架子已绑定流程卡,因为时间不确定,笼子内的玻璃可重新绑定新架子 |
| | | // list = tempList.stream().filter(item -> !listMap.containsKey(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | list = tempList; |
| | | } |
| | | } |
| | | } else { |
| | | if (flag08 && !"2".equals(glassStatus13)) { |
| | | //直接走人工下片 |
| | | list = tempList.stream().filter(item -> item.getWidth() > maxWidth || item.getHeight() > maxHeight).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | log.info("笼内玻璃无法执行出片"); |
| | | return Boolean.FALSE; |
| | | } |
| | | String tempGlassId = null; |
| | | Boolean isBind = Boolean.FALSE; |
| | | |
| | | for (DownStorageCageDetails item : list) { |
| | | if (item.getWidth() > maxWidth || item.getHeight() > maxHeight) { |
| | | if (flag08 && !"2".equals(glassStatus13)) { |
| | | log.info("玻璃宽度或高度超出阈值,执行人工下片"); |
| | | tempGlassId = item.getGlassId(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | loop: |
| | | if (tempGlassId == null) { |
| | | //获取正在落架的绑定流程卡的信息(流程卡、层数、落架数量) |
| | | List<DownGlassInfoDTO> downGlassInfoDTOList = downGlassInfoService.queryWorkStationIsIn(Boolean.TRUE); |
| | | List<String> downGlassFlowList = downGlassInfoDTOList.stream().map(item -> item.getFlowCardId() + ":" + item.getLayer()).collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(downGlassFlowList)) { |
| | | //架子都未绑定流程卡,出笼内子数量最多尺寸最大的玻璃 |
| | | DownStorageCageDetails downStorageCageDetails = downStorageCageDetailsService.getGlassInfoMaxCount(); |
| | | //绑定流程卡,更新玻璃状态,生成出片任务, |
| | | tempGlassId = downStorageCageDetails.getGlassId(); |
| | | isBind = Boolean.TRUE; |
| | | break loop; |
| | | } |
| | | //将笼子内的玻璃进行过滤,仅获取无法落架的流程卡玻璃 |
| | | List<DownStorageCageDetails> noDownLoadList = list.stream().filter(item -> !downGlassFlowList.contains(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(noDownLoadList)) { |
| | | //是否有空架子 |
| | | // List<DownWorkstation> emptyShelfList = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | // .isNull(DownWorkstation::getFlowCardId)); |
| | | if (isEmptyShelf) { |
| | | DownStorageCageDetails downStorageCageDetails = downStorageCageDetailsService.getGlassInfoMaxCount(); |
| | | //绑定流程卡,更新玻璃状态,生成出片任务 |
| | | tempGlassId = downStorageCageDetails.getGlassId(); |
| | | isBind = Boolean.TRUE; |
| | | break loop; |
| | | } |
| | | } |
| | | //将笼子内的玻璃进行过滤,仅获取可落架的流程卡玻璃 |
| | | List<DownStorageCageDetails> downLoadList = list.stream().filter(item -> downGlassFlowList.contains(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(downLoadList)) { |
| | | //不执行出片任务,笼内没有合适的出片玻璃 |
| | | return Boolean.FALSE; |
| | | } |
| | | //将笼内玻璃的流程卡+层号 和落架的流程卡 去重,得出展示无法落架的玻璃,判断玻璃数是否超过阈值 |
| | | //笼内玻璃是否可落架:笼内是否有需要中空的 |
| | | List<DownStorageCageDetails> multiLayerList = list.stream().filter(item -> item.getTotalLayer() >= 2).collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(multiLayerList)) { |
| | | for (DownStorageCageDetails item : multiLayerList) { |
| | | DownGlassInfoDTO downGlassInfoDTO = downGlassInfoService.queryDownGlassMaxLayer(item.getFlowCardId()); |
| | | if (null == downGlassInfoDTO) { |
| | | // 历史落架玻璃按照相关流程卡取数据库未找到最多玻璃信息,表明当前流程卡下的有层的玻璃均未落架,直接可出当前玻璃 |
| | | log.info(""); |
| | | isBind = Boolean.FALSE; |
| | | tempGlassId = item.getGlassId(); |
| | | break loop; |
| | | } |
| | | if (downGlassInfoDTO.getLayer().equals(downGlassInfoDTO.getLayer())) { |
| | | log.info("当前玻璃的流程在架子上落架最多,直接出片"); |
| | | //更新玻璃状态,生成出片任务 |
| | | tempGlassId = item.getGlassId(); |
| | | isBind = Boolean.FALSE; |
| | | break loop; |
| | | } |
| | | Integer sequence = downGlassInfoService.queryMaxSequence(item.getFlowCardId(), item.getLayer()); |
| | | log.info("获取当前玻璃需要放的次序:笼内同流程 同层数的通达次序+1:{}", sequence); |
| | | DownGlassInfo downGlassInfo = downGlassInfoService.getOne(new LambdaQueryWrapper<DownGlassInfo>() |
| | | .eq(DownGlassInfo::getFlowCardId, downGlassInfoDTO.getFlowCardId()) |
| | | .eq(DownGlassInfo::getLayer, downGlassInfoDTO.getLayer()).eq(DownGlassInfo::getSequence, sequence)); |
| | | if (null != downGlassInfoDTO && downGlassInfo.getWidth() == item.getWidth() && downGlassInfo.getHeight() == item.getHeight()) { |
| | | log.info("相同次序玻璃对应上,可执行进片任务"); |
| | | //更新玻璃状态,生成出片任务 |
| | | tempGlassId = item.getGlassId(); |
| | | isBind = Boolean.FALSE; |
| | | break loop; |
| | | } |
| | | } |
| | | } |
| | | |
| | | Map<String, List<DownStorageCageDetails>> singleLayerMap = list.stream().filter(item -> item.getTotalLayer() == 1) |
| | | .collect(Collectors.groupingBy(item -> item.getFlowCardId() + item.getLayer(), Collectors.toList())); |
| | | if (tempGlassId == null) { |
| | | if (CollectionUtils.isNotEmpty(singleLayerMap)) { |
| | | //获取已落架流程卡信息,按落架数量排序 |
| | | for (DownGlassInfoDTO e : downGlassInfoDTOList) { |
| | | List<DownStorageCageDetails> downStorageCageDetails = singleLayerMap.get(e.getFlowCardId() + e.getLayer()); |
| | | if (CollectionUtils.isNotEmpty(downStorageCageDetails)) { |
| | | tempGlassId = downStorageCageDetails.get(0).getGlassId(); |
| | | isBind = Boolean.FALSE; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (tempGlassId == null) { |
| | | log.info("没有找到可以下片的的玻璃,结束任务"); |
| | | return Boolean.FALSE; |
| | | } else { |
| | | //按照出片的玻璃id更新笼内的玻璃状态为已出片 |
| | | return generateDownGlassOutTask(tempGlassId, Const.GLASS_CACHE_TYPE_OUT, isBind, cageDetails); |
| | | } |
| | | } |
| | | |
| | | public Boolean generateDownGlassOutTask(String glassId, Integer taskType, Boolean isBind, DownStorageCageDetails cageDetails) { |
| | | //按玻璃id获取玻璃信息 |
| | | DownStorageCageDetails downStorageCageDetails = null; |
| | | if (glassId.equals(cageDetails.getGlassId())) { |
| | | downStorageCageDetails = cageDetails; |
| | | taskType = 3; |
| | | } else { |
| | | downStorageCageDetails = downStorageCageDetailsService.getOne(new LambdaQueryWrapper<DownStorageCageDetails>() |
| | | .eq(DownStorageCageDetails::getGlassId, glassId)); |
| | | } |
| | | |
| | | Integer endCell = null; |
| | | if (isBind) { |
| | | //获取空架子信息,将空架子信息绑定流程卡 |
| | | DownWorkstation emptyDownWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>() |
| | | .isNull(DownWorkstation::getFlowCardId).orderByDesc(DownWorkstation::getWorkstationId).last("limit 1")); |
| | | if (null != emptyDownWorkstation) { |
| | | log.info("获取到空架子信息,绑定流程卡"); |
| | | emptyDownWorkstation.setFlowCardId(downStorageCageDetails.getFlowCardId()); |
| | | emptyDownWorkstation.setLayer(downStorageCageDetails.getLayer()); |
| | | downWorkstationService.updateById(emptyDownWorkstation); |
| | | endCell = emptyDownWorkstation.getWorkstationId(); |
| | | } else { |
| | | log.info("没有空架子信息,无法绑定流程卡"); |
| | | return Boolean.FALSE; |
| | | } |
| | | } else { |
| | | DownWorkstation workstation = downWorkstationService.getOne(new LambdaUpdateWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getFlowCardId, downStorageCageDetails.getFlowCardId()).eq(DownWorkstation::getLayer, downStorageCageDetails.getLayer())); |
| | | endCell = workstation.getWorkstationId(); |
| | | } |
| | | //更新详情表内的状态 |
| | | if (downStorageCageDetailsService.update(new LambdaUpdateWrapper<DownStorageCageDetails>() |
| | | .set(DownStorageCageDetails::getState, Const.GLASS_STATE_OUT).eq(DownStorageCageDetails::getGlassId, glassId))) { |
| | | log.info("更新详情表内的状态成功"); |
| | | } else { |
| | | log.info("更新详情表内的状态失败"); |
| | | return Boolean.FALSE; |
| | | } |
| | | //生成任务信息 |
| | | DownGlassInfo downGlassInfo = new DownGlassInfo(); |
| | | BeanUtils.copyProperties(downStorageCageDetails, downGlassInfo); |
| | | downGlassInfoService.save(downGlassInfo); |
| | | //生成任务信息 |
| | | GlassInfo glassInfo = new GlassInfo(); |
| | | BeanUtils.copyProperties(downStorageCageDetails, glassInfo); |
| | | return initDownGlassTask(glassInfo, downStorageCageDetails.getSlot(), endCell, taskType); |
| | | } |
| | | |
| | | public Boolean initDownGlassTask(GlassInfo glassInfo, Integer startCell, Integer endCell, Integer taskType) { |
| | | log.info("玻璃{}生成进片任务", glassInfo.getGlassId()); |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | downGlassTask.setStartCell(startCell); |
| | | downGlassTask.setGlassId(glassInfo.getGlassId()); |
| | | downGlassTask.setEndCell(endCell); |
| | | downGlassTask.setTaskType(taskType + ""); |
| | | downGlassTask.setWidth((int) glassInfo.getWidth()); |
| | | downGlassTask.setHeight((int) glassInfo.getHeight()); |
| | | downGlassTask.setFlowCardId(glassInfo.getFlowCardId()); |
| | | downGlassTask.setLayer(glassInfo.getLayer()); |
| | | downGlassTask.setTaskStauts(0); |
| | | downGlassTask.setCreateTime(new Date()); |
| | | downGlassTaskService.save(downGlassTask); |
| | | //向plc发送命令 |
| | | return sendMessageToPlc((int) glassInfo.getWidth(), (int) glassInfo.getHeight(), (int) glassInfo.getThickness(), |
| | | startCell, endCell, taskType); |
| | | } |
| | | |
| | | private Boolean sendMessageToPlc(int width, int height, int thickness, int startCell, int endCell, int taskType) { |
| | | S7control s7control = S7object.getinstance().plccontrol; |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_width").getAddress(), (short) width); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_height").getAddress(), (short) height); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_thickness").getAddress(), (short) thickness); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Start_cell").getAddress(), (short) startCell); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("End_cell").getAddress(), (short) endCell); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("task_type").getAddress(), (short) taskType); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("confirmationWord").getAddress(), (short) 1); |
| | | return Boolean.TRUE; |
| | | } |
| | | } |
| | |
| | | {
|
| | | "plcAddressBegin": "DB100.0",
|
| | | "plcAddressLenght": "230",
|
| | | "plcAddressBegin": "DB11.0",
|
| | | "plcAddressLenght": "100",
|
| | | "dataType": "word",
|
| | | "parameteInfor": [
|
| | |
|
| | | {
|
| | | "codeId": "RequestWord",
|
| | | "codeId": "requestWord",
|
| | | "addressIndex": "0",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G04ID",
|
| | | "addressIndex": "30",
|
| | | "codeId": "requestID",
|
| | | "addressIndex": "2",
|
| | | "addressLenght": "30"
|
| | | },
|
| | | {
|
| | | "codeId": "G06RobotTaskRequestWord",
|
| | | "codeId": "currentCell",
|
| | | "addressIndex": "32",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06ID",
|
| | | "addressIndex": "62",
|
| | | "addressLenght": "30"
|
| | | "codeId": "glassStatus08",
|
| | | "addressIndex": "36",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11RobotTaskRequestWord",
|
| | | "codeId": "G06_glass_status",
|
| | | "addressIndex": "40",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11_glass_status",
|
| | | "addressIndex": "42",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G13_glass_status",
|
| | | "addressIndex": "44",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G04_error_status",
|
| | | "addressIndex": "48",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G05_error_status",
|
| | | "addressIndex": "50",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06_error_status",
|
| | | "addressIndex": "52",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "robot_error_status",
|
| | | "addressIndex": "54",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G08_error_status",
|
| | | "addressIndex": "56",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G09_error_status",
|
| | | "addressIndex": "58",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G10_error_status",
|
| | | "addressIndex": "60",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11_error_status",
|
| | | "addressIndex": "62",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "robot_error_status",
|
| | | "addressIndex": "64",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G011ID",
|
| | | "addressIndex": "94",
|
| | | "addressLenght": "30"
|
| | | "codeId": "G13_error_status",
|
| | | "addressIndex": "66",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "codeId": "confirmationWord",
|
| | | "addressIndex": "72",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06_prohibit_film_production",
|
| | | "addressIndex": "74",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11_prohibit_film_production",
|
| | | "addressIndex": "76",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G13_prohibit_film_production",
|
| | | "addressIndex": "78",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "Glass_width",
|
| | | "addressIndex": "82",
|
| | | "addressLenght": "4"
|
| | | },
|
| | | {
|
| | | "codeId": "Glass_height",
|
| | | "addressIndex": "86",
|
| | | "addressLenght": "4"
|
| | | },
|
| | | {
|
| | | "codeId": "Glass_thickness",
|
| | | "addressIndex": "90",
|
| | | "addressLenght": "4"
|
| | | },
|
| | | {
|
| | | "codeId": "Start_cell",
|
| | | "addressIndex": "94",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "End_cell",
|
| | | "addressIndex": "96",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "codeId": "task_type",
|
| | | "addressIndex": "98",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "100",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "102",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "MESSendingWord",
|
| | | "addressIndex": "104",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InputGrid",
|
| | | "addressIndex": "106",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "OutputGrid",
|
| | | "addressIndex": "108",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "OutputID",
|
| | | "addressIndex": "110",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "FrontOrRearLowerSlice",
|
| | | "addressIndex": "112",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "114",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06RobotTaskReply",
|
| | | "addressIndex": "116",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06Rack",
|
| | | "addressIndex": "118",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11RobotTaskReply",
|
| | | "addressIndex": "120",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11Rack",
|
| | | "addressIndex": "122",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "124",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "126",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "128",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "130",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "132",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "134",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "136",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "138",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "MESTaskState",
|
| | | "addressIndex": "140",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "142",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "AlarmState",
|
| | | "addressIndex": "144",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "Alarm1",
|
| | | "addressIndex": "146",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "Alarm2",
|
| | | "addressIndex": "148",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "Alarm3",
|
| | | "addressIndex": "150",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "Alarm4",
|
| | | "addressIndex": "152",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "neirong",
|
| | | "addressIndex": "154",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "device",
|
| | | "addressIndex": "156",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "158",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "160",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut1",
|
| | | "addressIndex": "162",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut2",
|
| | | "addressIndex": "164",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut3",
|
| | | "addressIndex": "166",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut4",
|
| | | "addressIndex": "168",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut5",
|
| | | "addressIndex": "170",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut6",
|
| | | "addressIndex": "172",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut7",
|
| | | "addressIndex": "174",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "176",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "178",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "180",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "182",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "184",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G04ActionState",
|
| | | "addressIndex": "186",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G05ActionState",
|
| | | "addressIndex": "190",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06ActionState",
|
| | | "addressIndex": "192",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G07ActionState",
|
| | | "addressIndex": "194",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G08ActionState",
|
| | | "addressIndex": "196",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G09ActionState",
|
| | | "addressIndex": "200",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G10ActionState",
|
| | | "addressIndex": "202",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11ActionState",
|
| | | "addressIndex": "204",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G12ActionState",
|
| | | "addressIndex": "206",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G13ActionState",
|
| | | "addressIndex": "208",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G04IDS",
|
| | | "addressIndex": "210",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G05IDS",
|
| | | "addressIndex": "212",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06IDS",
|
| | | "addressIndex": "214",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G07IDS",
|
| | | "addressIndex": "216",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G08IDS",
|
| | | "addressIndex": "218",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G09IDS",
|
| | | "addressIndex": "220",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G10IDS",
|
| | | "addressIndex": "222",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11IDS",
|
| | | "addressIndex": "224",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G12IDS",
|
| | | "addressIndex": "226",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G13ID",
|
| | | "addressIndex": "230",
|
| | | "addressLenght": "2"
|
| | | }
|
| | |
|
| | | ]
|
| | | } |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: cz |
| | | active: dev |
| | | application: |
| | | name: unLoadGlass |
| | | |
| | |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | mes: |
| | | maxWidth: 1000 #下片的最大宽度 |
| | | maxHeight: 1000 #下片的最大高度 |
| | | throughWidth: 3000 |
| | | throughHeight: 3000 |
| | | threshold: 5 #下片的最大阈值 |
New file |
| | |
| | | <?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.mes.downglassinfo.mapper.DownGlassInfoMapper"> |
| | | |
| | | <resultMap id="downGlassInfoDTO" type="com.mes.downworkstation.entity.dto.DownGlassInfoDTO"> |
| | | <result column="flow_card_id" property="flowCardId"/> |
| | | <result column="layer" property="layer"/> |
| | | <result column="count" property="count"/> |
| | | </resultMap> |
| | | <resultMap id="downGlassInfo" type="com.mes.downworkstation.entity.dto.DownGlassInfoDTO"> |
| | | <result column="flow_card_id" property="flowCardId"/> |
| | | <result column="layer" property="layer"/> |
| | | <result column="count" property="count"/> |
| | | <collection property="glassInfoList" ofType="com.mes.glassinfo.entity.GlassInfo"> |
| | | <id column="id" property="id"/> |
| | | <result column="flow_card_id" property="flowCardId"/> |
| | | <result column="glass_type" property="glassType"/> |
| | | <result column="width" property="width"/> |
| | | <result column="height" property="height"/> |
| | | <result column="thickness" property="thickness"/> |
| | | <result column="filmsid" property="filmsid"/> |
| | | <result column="total_layer" property="totalLayer"/> |
| | | <result column="layer" property="layer"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | <select id="queryDownGlassMaxLayer" resultMap="downGlassInfoDTO"> |
| | | SELECT flow_card_id, |
| | | layer, |
| | | COUNT(layer) AS count |
| | | FROM |
| | | down_glass_info |
| | | WHERE |
| | | flow_card_id = #{flowCardId} |
| | | GROUP BY |
| | | flow_card_id, |
| | | layer |
| | | order by count desc limit 1 |
| | | </select> |
| | | <select id="queryMaxSequence" resultType="java.lang.Integer"> |
| | | SELECT max(sequence) + 1 as sequence |
| | | FROM down_glass_info |
| | | WHERE flow_card_id = #{flowCardId} |
| | | AND layer = #{layer} |
| | | </select> |
| | | |
| | | <select id="queryWorkStationIsIn" resultMap="downGlassInfo"> |
| | | SELECT T.* |
| | | <if test="!isDownload"> |
| | | ,T1.* |
| | | </if> |
| | | FROM ( |
| | | SELECT T.FLOW_CARD_ID, |
| | | T.LAYER, |
| | | COUNT(T.LAYER) AS COUNT |
| | | FROM |
| | | DOWN_WORKSTATION T |
| | | LEFT JOIN DOWN_GLASS_INFO T1 ON T.FLOW_CARD_ID = T1.FLOW_CARD_ID |
| | | GROUP BY T.FLOW_CARD_ID,LAYER |
| | | HAVING T.FLOW_CARD_ID IS NOT NULL |
| | | ) T |
| | | INNER JOIN GLASS_INFO T1 ON T.FLOW_CARD_ID = T1.FLOW_CARD_ID |
| | | AND T.LAYER = T1.LAYER |
| | | LEFT JOIN DOWN_GLASS_INFO T2 ON T1.GLASS_ID = T2.GLASS_ID |
| | | <where> |
| | | <if test="isDownload"> |
| | | AND T2.GLASS_ID IS NULL |
| | | </if> |
| | | <if test="!isDownload"> |
| | | AND T2.GLASS_ID IS not NULL |
| | | </if> |
| | | </where> |
| | | order by t.count desc |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?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.mes.downstorage.mapper.DownStorageCageDetailsMapper"> |
| | | |
| | | <resultMap id="downStorageCageDetails" type="com.mes.downstorage.entity.DownStorageCageDetails"> |
| | | <id column="id" property="id"/> |
| | | <result column="slot" property="slot"/> |
| | | <result column="glass_id" property="glassId"/> |
| | | <result column="sequence" property="sequence"/> |
| | | <result column="filmsid" property="filmsid"/> |
| | | <result column="flow_card_id" property="flowCardId"/> |
| | | <result column="glass_type" property="glassType"/> |
| | | <result column="width" property="width"/> |
| | | <result column="height" property="height"/> |
| | | <result column="thickness" property="thickness"/> |
| | | <result column="tempering_layout_id" property="temperingLayoutId"/> |
| | | <result column="tempering_feed_sequence" property="temperingFeedSequence"/> |
| | | <result column="state" property="state"/> |
| | | <result column="gap" property="gap"/> |
| | | <result column="total_layer" property="totalLayer"/> |
| | | <result column="layer" property="layer"/> |
| | | </resultMap> |
| | | |
| | | <select id="getGlassInfoMaxCount" resultMap="downStorageCageDetails"> |
| | | SELECT * |
| | | FROM DOWN_STORAGE_CAGE_DETAILS |
| | | WHERE (FLOW_CARD_ID, LAYER) = (SELECT FLOW_CARD_ID, LAYER |
| | | FROM DOWN_STORAGE_CAGE_DETAILS |
| | | WHERE STATE = 100 |
| | | GROUP BY FLOW_CARD_ID, LAYER |
| | | ORDER BY COUNT(FLOW_CARD_ID) DESC |
| | | LIMIT 1 ) |
| | | AND STATE = 100 |
| | | ORDER BY |
| | | WIDTH DESC, |
| | | HEIGHT DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | |
| | | </mapper> |