Compare commits
11 Commits
10c2414204
...
5f5a60eb29
Author | SHA1 | Date | |
---|---|---|---|
5f5a60eb29 | |||
1684075a9c | |||
4e932a09fd | |||
|
fe10292885 | ||
|
c284a4b394 | ||
|
00c907ece0 | ||
3b7cc67690 | |||
|
c588346c69 | ||
|
391b52b23a | ||
|
a16cd349cc | ||
|
867aef5f50 |
@ -7,9 +7,9 @@ spring:
|
||||
# password: 1qazxsw2
|
||||
|
||||
#MySQL-remote
|
||||
# url: jdbc:mysql://mysql.picaiba.com:30307/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
# username: root
|
||||
# password: 1qaz@WSX3edc$RFV
|
||||
url: jdbc:mysql://mysql.picaiba.com:30307/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
username: root
|
||||
password: 1qaz@WSX3edc$RFV
|
||||
# #Oracle
|
||||
# driver-class-name: oracle.jdbc.OracleDriver
|
||||
# url: jdbc:oracle:thin:@192.168.10.10:1521:xe
|
||||
|
@ -33,8 +33,9 @@ spring:
|
||||
enabled: true
|
||||
redis:
|
||||
database: 6
|
||||
#host: 10.0.1.249
|
||||
host: 192.168.0.102
|
||||
#host: 127.0.0.1
|
||||
host: 10.0.1.249
|
||||
#host: 192.168.0.102
|
||||
port: 6379
|
||||
password: '' # 密码(默认为空)
|
||||
timeout: 6000ms # 连接超时时长(毫秒)
|
||||
|
@ -31,7 +31,7 @@ import java.util.Map;
|
||||
* 打印标签模板表 前端控制器
|
||||
*
|
||||
* @author codeGenerator
|
||||
* @since 2023-02-20
|
||||
* @since 2023-03-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/code/printModel")
|
||||
|
@ -14,7 +14,7 @@ import java.math.BigDecimal;
|
||||
* 打印标签模板表
|
||||
*
|
||||
* @author codeGenerator
|
||||
* @since 2023-02-20
|
||||
* @since 2023-03-08
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "打印标签模板表DTO对象")
|
||||
@ -77,4 +77,7 @@ public class PrintModelDTO implements Serializable {
|
||||
@ApiModelProperty(value = "线体,1=F ; 2=S (用于过程1比对,和包装打印)(设备传给我们的)")
|
||||
private Integer lineBody;
|
||||
|
||||
@ApiModelProperty(value = "是否启用,0 停用;1 启用")
|
||||
private Integer isEnable;
|
||||
|
||||
}
|
@ -14,7 +14,7 @@ import lombok.Data;
|
||||
* </p>
|
||||
*
|
||||
* @author codeGenerator
|
||||
* @since 2023-02-20
|
||||
* @since 2023-03-08
|
||||
*/
|
||||
@Data
|
||||
@TableName("t_print_model")
|
||||
@ -78,6 +78,9 @@ public class PrintModel implements Serializable {
|
||||
@ApiModelProperty("线体,1=F ; 2=S (用于过程1比对,和包装打印)(设备传给我们的)")
|
||||
private Integer lineBody;
|
||||
|
||||
@ApiModelProperty("是否启用,0 停用;1 启用")
|
||||
private Integer isEnable;
|
||||
|
||||
|
||||
public static final String ID = "ID";
|
||||
|
||||
@ -115,4 +118,6 @@ public class PrintModel implements Serializable {
|
||||
|
||||
public static final String LINE_BODY = "line_body";
|
||||
|
||||
public static final String IS_ENABLE = "is_enable";
|
||||
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import java.util.Date;
|
||||
* 打印标签模板表
|
||||
*
|
||||
* @author codeGenerator
|
||||
* @since 2023-02-20
|
||||
* @since 2023-03-08
|
||||
*/
|
||||
@Data
|
||||
public class PrintModelExcel {
|
||||
@ -52,5 +52,7 @@ public class PrintModelExcel {
|
||||
private String content;
|
||||
@Excel(name = "线体,1=F ; 2=S (用于过程1比对,和包装打印)(设备传给我们的)")
|
||||
private Integer lineBody;
|
||||
@Excel(name = "是否启用,0 停用;1 启用")
|
||||
private Integer isEnable;
|
||||
|
||||
}
|
@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
* 打印标签模板表
|
||||
*
|
||||
* @author codeGenerator
|
||||
* @since 2023-02-20
|
||||
* @since 2023-03-08
|
||||
*/
|
||||
@Mapper
|
||||
public interface PrintModelMapper extends BaseDao<PrintModel> {
|
||||
|
@ -20,6 +20,7 @@
|
||||
<id column="IS_PREVIEW" property="isPreview" />
|
||||
<id column="CONTENT" property="content" />
|
||||
<id column="line_body" property="lineBody" />
|
||||
<id column="is_enable" property="isEnable" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
|
@ -1,7 +1,7 @@
|
||||
-- 菜单初始SQL
|
||||
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date)VALUES (1627506543435272194, 1067246875800000035, '打印标签模板表', 'packing/printModel', NULL, 0, 'icon-desktop', 0, 1067246875800000001, now(), 1067246875800000001, now());
|
||||
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627506543435272195, 1627506543435272194, '查看', NULL, 'packing:printModel:page,packing:printModel:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
|
||||
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627506543435272196, 1627506543435272194, '新增', NULL, 'packing:printModel:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
|
||||
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627506543435272197, 1627506543435272194, '修改', NULL, 'packing:printModel:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
|
||||
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627506543435272198, 1627506543435272194, '删除', NULL, 'packing:printModel:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
|
||||
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627506543435272199, 1627506543435272194, '导出', NULL, 'packing:printModel:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
|
||||
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date)VALUES (1633305189284167681, 1067246875800000035, '打印标签模板表', 'code/printModel', NULL, 0, 'icon-desktop', 0, 1067246875800000001, now(), 1067246875800000001, now());
|
||||
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1633305189284167682, 1633305189284167681, '查看', NULL, 'code:printModel:page,code:printModel:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
|
||||
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1633305189284167683, 1633305189284167681, '新增', NULL, 'code:printModel:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
|
||||
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1633305189284167684, 1633305189284167681, '修改', NULL, 'code:printModel:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
|
||||
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1633305189284167685, 1633305189284167681, '删除', NULL, 'code:printModel:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
|
||||
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1633305189284167686, 1633305189284167681, '导出', NULL, 'code:printModel:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
|
||||
|
@ -8,7 +8,7 @@ import com.cnbm.generator.code.entity.PrintModel;
|
||||
* 打印标签模板表
|
||||
*
|
||||
* @author codeGenerator
|
||||
* @since 2023-02-20
|
||||
* @since 2023-03-08
|
||||
*/
|
||||
public interface PrintModelServiceBiz extends CrudService<PrintModel, PrintModelDTO> {
|
||||
|
||||
|
@ -15,7 +15,7 @@ import java.util.Map;
|
||||
* 打印标签模板表
|
||||
*
|
||||
* @author codeGenerator
|
||||
* @since 2023-02-20
|
||||
* @since 2023-03-08
|
||||
*/
|
||||
@Service
|
||||
public class PrintModelServiceBizImpl extends CrudServiceImpl<PrintModelMapper, PrintModel, PrintModelDTO> implements PrintModelServiceBiz {
|
||||
|
@ -152,7 +152,7 @@ public class KukaJoinThread implements ApplicationRunner {
|
||||
|
||||
|
||||
public String getBoxId(String sapMaterial){
|
||||
Integer todayBoxNum = service.getTodayBoxNum();
|
||||
Integer todayBoxNum = service.getTodayBoxNum()+1;
|
||||
String nowTime = DateUtil.format(new Date(), "yyMMdd");
|
||||
|
||||
todayBoxNum+=500;
|
||||
@ -160,6 +160,15 @@ public class KukaJoinThread implements ApplicationRunner {
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
public String getErrorBoxId(String sapMaterial){
|
||||
|
||||
String nowTime = DateUtil.format(new Date(), "yyMMdd");
|
||||
String mixBoxError = "001";
|
||||
String res = "Err"+sapMaterial+nowTime+mixBoxError;
|
||||
return res;
|
||||
}
|
||||
|
||||
public String removeKG(String str){
|
||||
return str.substring(0,17);
|
||||
}
|
||||
@ -174,240 +183,270 @@ public class KukaJoinThread implements ApplicationRunner {
|
||||
return f1.format(a);
|
||||
}
|
||||
|
||||
//return true 出现混档了,return false 没有出现混档
|
||||
private boolean isMixLevel(String[] subIds){
|
||||
String correctLevel = substrateServiceBiz.getBySubId(subIds[0]).getPowerLevel();
|
||||
String errMsg = "以下基板ID出现混档:";
|
||||
boolean res = false;
|
||||
for(int i=1;i<subIds.length;i++){
|
||||
String powerLevel = substrateServiceBiz.getBySubId(subIds[i]).getPowerLevel();
|
||||
|
||||
if(!powerLevel.equals(correctLevel)){
|
||||
errMsg+="基板ID:"+subIds[i]+" 档位:"+powerLevel+", ";
|
||||
res = true;
|
||||
}
|
||||
}
|
||||
if(res){
|
||||
logger.error(errMsg);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
|
||||
// kukaStep1.scheduleAtFixedRate(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// try {
|
||||
//
|
||||
// //调度开始
|
||||
//// logger.info("");
|
||||
//// logger.info("================= 现在开始执行 过程一 任务 ==================");
|
||||
// Integer subArrived = waitingForTarget(Step1Plc2MesVar.SubArrivedToMes, true);
|
||||
// if(subArrived != 1){
|
||||
// logger.info("标签打印Event--- 失败"+" --- "+" MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
|
||||
// }
|
||||
//
|
||||
// //一. 从plc 中获取 subId 和 lineNum
|
||||
// String subId = (String) read(S7Client.S7_KUKA,Step1Plc2MesVar.SubIdToMes);
|
||||
// Integer lineNum = (Integer) read(S7Client.S7_KUKA,Step1Plc2MesVar.LineNum);
|
||||
// //把基板ID字符串的空格去掉,因为plc中设置的20位,但实际基板ID就是17位,因为带空格去数据库查询 有问题的。
|
||||
// subId = removeKG(subId);
|
||||
//
|
||||
// //二. MES 业务
|
||||
// //=============== MES 业务 开始 =================
|
||||
// //1. 从comline数据库中获取 实际pmpp
|
||||
// float pmppBySubId = service.getPMPPBySubId(subId);
|
||||
// //2. 匹配和计算补偿功率
|
||||
// float actualPMPP = compensationPowerServiceBiz.calculCompensationPMPP(pmppBySubId,lineNum);
|
||||
// //3. 依据补偿功率,获取工艺参数,并且把这些工艺参数传给kuka
|
||||
// WoPowerLevel argByPMPP = levelServiceBiz.getArgByPMPP(actualPMPP, lineNum);
|
||||
// write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Pnom,Integer.valueOf(argByPMPP.getPowerClass()));
|
||||
// write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Voc,argByPMPP.getLableVoc());
|
||||
// write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Isc,argByPMPP.getLableIsc());
|
||||
// write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Vmpp,argByPMPP.getLableVmpp());
|
||||
// write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Impp,argByPMPP.getLableImpp());
|
||||
// logger.info("标签打印Event--- 采集到 基板ID: "+subId+", 线边号:"+lineNum+",从camline 获取到实际pmpp"+pmppBySubId+",计算后 补偿功率:"+actualPMPP+",dLable_Pnom: "+argByPMPP.getPowerClass() +",dLable_Voc: "+argByPMPP.getLableVoc()+",dLable_Isc: "+argByPMPP.getLableIsc()+",dLable_Vmpp: "+argByPMPP.getLableVmpp()+",dLable_Impp: "+argByPMPP.getLableImpp());
|
||||
//
|
||||
//
|
||||
//
|
||||
// //4. 把基板录到数据库
|
||||
// WoPackagingBoxSubstrate woPackagingBoxSubstrate = new WoPackagingBoxSubstrate();
|
||||
// woPackagingBoxSubstrate.setLineBody(lineNum);
|
||||
// woPackagingBoxSubstrate.setPowerLevel(argByPMPP.getPowerClass());
|
||||
// woPackagingBoxSubstrate.setSapMaterial(argByPMPP.getSapMaterialNum());
|
||||
// woPackagingBoxSubstrate.setWoSubstrateId(subId);
|
||||
// woPackagingBoxSubstrate.setActualPmpp(pmppBySubId);
|
||||
// woPackagingBoxSubstrate.setCreateTime(LocalDateTime.now());
|
||||
//
|
||||
//
|
||||
// //5. 从camline那里获取可变字段
|
||||
// CamlineExtendArgDTO extendArgFromCamline = service.getExtendArgFromCamline(subId);
|
||||
// logger.info("标签打印Event--- 基板ID: "+subId+", 从camline获取PID16~PID22 的实测数据 成功, 数据内容:"+extendArgFromCamline.toString());
|
||||
// woPackagingBoxSubstrate.setLastUpdateTime(extendArgFromCamline.getLastUpdateTime());
|
||||
// woPackagingBoxSubstrate.setPmpp(actualPMPP);
|
||||
// woPackagingBoxSubstrate.setOrderName(extendArgFromCamline.getOrderName());
|
||||
// woPackagingBoxSubstrate.setBinclassFl1(extendArgFromCamline.getBinclassFl1());
|
||||
// woPackagingBoxSubstrate.setBinclassFl2(extendArgFromCamline.getBinclassFl2());
|
||||
// woPackagingBoxSubstrate.setEtaFl1(extendArgFromCamline.getEtaFl1());
|
||||
// woPackagingBoxSubstrate.setEtaFl2(extendArgFromCamline.getEtaFl2());
|
||||
// woPackagingBoxSubstrate.setFfFl1(extendArgFromCamline.getFfFl1());
|
||||
// woPackagingBoxSubstrate.setFfFl2(extendArgFromCamline.getFfFl2());
|
||||
// woPackagingBoxSubstrate.setImppFl1(extendArgFromCamline.getImppFl1());
|
||||
// woPackagingBoxSubstrate.setImppFl2(extendArgFromCamline.getImppFl2());
|
||||
// woPackagingBoxSubstrate.setInsolflashcontrolFl1(extendArgFromCamline.getInsolflashcontrolFl1());
|
||||
// woPackagingBoxSubstrate.setInsolflashcontrolFl2(extendArgFromCamline.getInsolflashcontrolFl2());
|
||||
// woPackagingBoxSubstrate.setInsolmppFl1(extendArgFromCamline.getInsolmppFl1());
|
||||
// woPackagingBoxSubstrate.setInsolmppFl2(extendArgFromCamline.getInsolmppFl2());
|
||||
// woPackagingBoxSubstrate.setInsolvocFl1(extendArgFromCamline.getInsolvocFl1());
|
||||
// woPackagingBoxSubstrate.setInsolvocFl2(extendArgFromCamline.getInsolvocFl2());
|
||||
// woPackagingBoxSubstrate.setInsolFl1(extendArgFromCamline.getInsolFl1());
|
||||
// woPackagingBoxSubstrate.setInsolFl2(extendArgFromCamline.getInsolFl2());
|
||||
// woPackagingBoxSubstrate.setIscFl1(extendArgFromCamline.getIscFl1());
|
||||
// woPackagingBoxSubstrate.setIscFl2(extendArgFromCamline.getIscFl2());
|
||||
// woPackagingBoxSubstrate.setMeasTimeFl1(extendArgFromCamline.getMeasTimeFl1());
|
||||
// woPackagingBoxSubstrate.setMeasTimeFl2(extendArgFromCamline.getMeasTimeFl2());
|
||||
// woPackagingBoxSubstrate.setPmppFl1(extendArgFromCamline.getPmppFl1());
|
||||
// woPackagingBoxSubstrate.setPmppFl2(extendArgFromCamline.getPmppFl2());
|
||||
// woPackagingBoxSubstrate.setTcellFl1(extendArgFromCamline.getTcellFl1());
|
||||
// woPackagingBoxSubstrate.setTcellFl2(extendArgFromCamline.getTcellFl2());
|
||||
// woPackagingBoxSubstrate.setTmonicellFl1(extendArgFromCamline.getTmonicellFl1());
|
||||
// woPackagingBoxSubstrate.setTmonicellFl2(extendArgFromCamline.getTmonicellFl2());
|
||||
// woPackagingBoxSubstrate.setUmppFl1(extendArgFromCamline.getUmppFl1());
|
||||
// woPackagingBoxSubstrate.setUmppFl2(extendArgFromCamline.getUmppFl2());
|
||||
// woPackagingBoxSubstrate.setUocFl1(extendArgFromCamline.getUocFl1());
|
||||
// woPackagingBoxSubstrate.setUocFl1(extendArgFromCamline.getUocFl2());
|
||||
//
|
||||
// substrateServiceBiz.insert(woPackagingBoxSubstrate);
|
||||
// logger.info("标签打印Event--- 基板ID: "+subId+", 录入数据库成功");
|
||||
// //=============== MES 业务 结束 =================
|
||||
//
|
||||
// //三. 当MES完成任务后,把MesToPlc.SubArrivedFinish变量置为true,告诉plc,我操作完成了
|
||||
// write(S7Client.S7_KUKA,Step1Mes2PlcVar.SubArrivedFinish,true);
|
||||
// logger.info("标签打印Event--- 基板ID: "+subId+", SubArrivedFinish,置为true 成功");
|
||||
// //四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
|
||||
// Integer subArrived2 = waitingForTarget(Step1Plc2MesVar.SubArrivedToMes, false);
|
||||
// if(subArrived2 != 1){
|
||||
// logger.info("标签打印Event--- 失败"+" --- "+"MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
|
||||
// }
|
||||
//
|
||||
// write(S7Client.S7_KUKA,Step1Mes2PlcVar.SubArrivedFinish,false);
|
||||
// logger.info("标签打印Event--- 基板ID: "+subId+", SubArrivedFinish,置为 false 成功, Event1 成功结束");
|
||||
//
|
||||
// }catch (Throwable e){
|
||||
// logger.info("标签打印Event--- :"+e.getMessage());
|
||||
// }
|
||||
// }
|
||||
// },1,1, TimeUnit.SECONDS);
|
||||
//
|
||||
//
|
||||
// kukaStep2.scheduleAtFixedRate(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// try {
|
||||
//
|
||||
// //调度开始
|
||||
// Integer shelfIsFull = waitingForTarget(Step2Plc2MesVar.ShelfIsFull, true);
|
||||
// if(shelfIsFull != 1){
|
||||
// logger.info("BOXID生成Event-------失败"+" --- "+"MES监听 Step2Plc2MesVar.ShelfIsFull 是否 等于 1 失败");
|
||||
// }
|
||||
//
|
||||
// //一. 从plc 中获取 subIdList 和 lineNum
|
||||
// String[] subIdList = (String[])read(S7Client.S7_KUKA,Step2Plc2MesVar.SubIdList);
|
||||
// Integer listSize = (Integer)read(S7Client.S7_KUKA,Step2Plc2MesVar.PackageNumberSet);
|
||||
//
|
||||
// //二. MES 业务
|
||||
// //=============== MES 业务 开始 =================
|
||||
// //1.MES 生成BoxId
|
||||
// if(subIdList.length<=0){
|
||||
// logger.info("BOXID生成Event-------失败"+" --- "+"从plc里面获取到的基板列表 为空");
|
||||
// throw new Exception("BOXID生成Event-------kuka机械手 取到了空箱");
|
||||
// }
|
||||
// //真实的基板ID 就是17位的,plc读取过来,有空格,要把后面3位空格去掉就行了。
|
||||
// for(int i=0;i<subIdList.length;i++){
|
||||
// subIdList[i] = removeKG(subIdList[i]);
|
||||
// }
|
||||
// logger.info("BOXID生成Event-------获取到基板列表:"+ Arrays.toString(subIdList)+",基板数量:"+listSize);
|
||||
//
|
||||
// WoPackagingBoxSubstrate bySubId = substrateServiceBiz.getBySubId(subIdList[0]);
|
||||
// //如果我们系统中找不到这块基板那么就去camline里面找
|
||||
// if(bySubId == null){
|
||||
// //todo
|
||||
// CamlineSubIdDTO subIdByCamline = service.getSubIdByCamline(subIdList[0]);
|
||||
// bySubId = new WoPackagingBoxSubstrate();
|
||||
// bySubId.setPowerLevel(subIdByCamline.getPowerLevel());
|
||||
// bySubId.setSapMaterial(subIdByCamline.getSapMaterial());
|
||||
// bySubId.setLineBody(2);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// String boxId = getBoxId(bySubId.getSapMaterial());
|
||||
// logger.info("BOXID生成Event-------mes 生成的boxId :"+ boxId);
|
||||
// //2. 依次update 基板表,把boxId 赋予这些基板
|
||||
// for(int i=0;i<listSize;i++){
|
||||
// substrateServiceBiz.updatePackagingBoxIdAndSlotByWoSubstrateId(boxId,(i+1),subIdList[i]);
|
||||
// }
|
||||
// //3.去camline数据库 查询此基板ID 对应的订单
|
||||
// String orderNameBySubId = service.getOrderNameBySubId(subIdList[0]);
|
||||
// //4. box信息录入到box表
|
||||
// WoPackagingBox woPackagingBox = new WoPackagingBox();
|
||||
// woPackagingBox.setBoxNo(boxId);
|
||||
// woPackagingBox.setPackagingTime(LocalDateTime.now());
|
||||
// woPackagingBox.setPowerLevel(bySubId.getPowerLevel());
|
||||
// woPackagingBox.setLineBody(bySubId.getLineBody());
|
||||
// woPackagingBox.setSapMaterial(bySubId.getSapMaterial());
|
||||
// woPackagingBox.setOrderNum(orderNameBySubId);
|
||||
// //1-手动模式,2-自动模式
|
||||
// woPackagingBox.setModel(2);
|
||||
// woPackagingBox.setCreateTime(LocalDateTime.now());
|
||||
// boxServiceBiz.insert(woPackagingBox);
|
||||
// logger.info("BOXID生成Event-------boxId :"+ boxId+"写入数据库成功");
|
||||
// //=============== MES 业务 结束 =================
|
||||
//
|
||||
// //三. 把生成的BoxId 告诉kuka
|
||||
// write(S7Client.S7_KUKA,Step2Mes2PlcVar.BoxId,boxId);
|
||||
// logger.info("BOXID生成Event-------boxId :"+ boxId+"传给PLC 成功");
|
||||
//
|
||||
// //四. 当MES完成任务后,把MesToPlc.ShelfIsFullFinish变量置为true,告诉plc,我操作完成了
|
||||
// write(S7Client.S7_KUKA,Step2Mes2PlcVar.ShelfIsFullFinish,true);
|
||||
// logger.info("BOXID生成Event-------boxId :"+ boxId+"ShelfIsFullFinish 置为true 成功");
|
||||
// //四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
|
||||
// Integer subArrived2 = waitingForTarget(Step2Plc2MesVar.ShelfIsFull, false);
|
||||
// if(subArrived2 != 1){
|
||||
// logger.info("BOXID生成Event-------失败"+" --- "+"步骤1. MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
|
||||
// }
|
||||
// write(S7Client.S7_KUKA,Step2Mes2PlcVar.ShelfIsFullFinish,false);
|
||||
// logger.info("BOXID生成Event-------boxId :"+ boxId+"ShelfIsFullFinish 置为false 成功,Event2 成功结束");
|
||||
// }catch (Throwable e){
|
||||
// logger.info("BOXID生成Event------- :" + e.getMessage());
|
||||
// }
|
||||
// }
|
||||
// },1,1, TimeUnit.SECONDS);
|
||||
//
|
||||
//
|
||||
// kukaStep3.scheduleAtFixedRate(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// try {
|
||||
//
|
||||
// //调度开始
|
||||
// Integer shelfIsFull = waitingForTarget(Step3Plc2MesVar.ShelfIsFullArrived, true);
|
||||
// if(shelfIsFull != 1){
|
||||
// logger.info("装箱单打印Event------失败"+" --- "+"MES监听 Step3Plc2MesVar.ShelfIsFullArrived 是否 等于 1 失败");
|
||||
// }
|
||||
//
|
||||
// //一. 从plc 中获取 subIdList 和 lineNum
|
||||
// String boxId = (String)read(S7Client.S7_KUKA,Step3Plc2MesVar.BoxId);
|
||||
// Integer lineNum = (Integer) read(S7Client.S7_KUKA,Step3Plc2MesVar.LineNum);
|
||||
// logger.info("装箱单打印Event------到达站台的boxId :"+boxId);
|
||||
//
|
||||
// //二. MES 业务
|
||||
// //=============== MES 业务 开始 =================
|
||||
// //1. box信息录入到box表
|
||||
// boxServiceBiz.updateIsArrivedByBoxNo(1,boxId);
|
||||
// logger.info("装箱单打印Event------boxId :"+boxId+"更新数据库成功");
|
||||
// //=============== MES 业务 结束 =================
|
||||
//
|
||||
//
|
||||
// //四. 当MES完成任务后,把MesToPlc.ShelfIsFullArrivedFinish变量置为true,告诉plc,我操作完成了
|
||||
// write(S7Client.S7_KUKA,Step3Mes2PlcVar.ShelfIsFullArrivedFinish,true);
|
||||
// logger.info("装箱单打印Event------boxId :"+boxId+", ShelfIsFullArrivedFinish置为true 成功");
|
||||
// //四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
|
||||
// Integer subArrived2 = waitingForTarget(Step3Plc2MesVar.ShelfIsFullArrived, false);
|
||||
// if(subArrived2 != 1){
|
||||
// logger.info("装箱单打印Event------失败"+" --- "+"步骤1. MES监听 Step3Plc2MesVar.ShelfIsFullArrived 是否 等于 1 失败");
|
||||
// }
|
||||
// logger.info("装箱单打印Event------boxId :"+boxId+", 监听到subArrived=false 成功");
|
||||
// write(S7Client.S7_KUKA,Step3Mes2PlcVar.ShelfIsFullArrivedFinish,false);
|
||||
// logger.info("装箱单打印Event------boxId :"+boxId+", Even3 成功");
|
||||
// }catch (Throwable e){
|
||||
// logger.info("装箱单打印Event------"+e.getMessage());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// },1,1, TimeUnit.SECONDS);
|
||||
kukaStep1.scheduleAtFixedRate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
//调度开始
|
||||
// logger.info("");
|
||||
// logger.info("================= 现在开始执行 过程一 任务 ==================");
|
||||
Integer subArrived = waitingForTarget(Step1Plc2MesVar.SubArrivedToMes, true);
|
||||
if(subArrived != 1){
|
||||
logger.info("标签打印Event--- 失败"+" --- "+" MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
|
||||
}
|
||||
|
||||
//一. 从plc 中获取 subId 和 lineNum
|
||||
String subId = (String) read(S7Client.S7_KUKA,Step1Plc2MesVar.SubIdToMes);
|
||||
Integer lineNum = (Integer) read(S7Client.S7_KUKA,Step1Plc2MesVar.LineNum);
|
||||
//把基板ID字符串的空格去掉,因为plc中设置的20位,但实际基板ID就是17位,因为带空格去数据库查询 有问题的。
|
||||
subId = removeKG(subId);
|
||||
|
||||
//二. MES 业务
|
||||
//=============== MES 业务 开始 =================
|
||||
//1. 从comline数据库中获取 实际pmpp
|
||||
float pmppActual = service.getPMPPBySubId(subId);
|
||||
//2. 匹配和计算补偿功率
|
||||
float pmppCompensation = compensationPowerServiceBiz.calculCompensationPMPP(pmppActual,lineNum);
|
||||
//3. 依据补偿功率,获取工艺参数,并且把这些工艺参数传给kuka
|
||||
WoPowerLevel argByPMPP = levelServiceBiz.getArgByPMPP(pmppCompensation, lineNum);
|
||||
write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Pnom,Integer.valueOf(argByPMPP.getPowerClass()));
|
||||
write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Voc,argByPMPP.getLableVoc());
|
||||
write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Isc,argByPMPP.getLableIsc());
|
||||
write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Vmpp,argByPMPP.getLableVmpp());
|
||||
write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Impp,argByPMPP.getLableImpp());
|
||||
logger.info("标签打印Event--- 采集到 基板ID: "+subId+", 线边号:"+lineNum+",从camline 获取到实际pmpp"+pmppActual+",计算后 补偿功率:"+pmppCompensation+",dLable_Pnom: "+argByPMPP.getPowerClass() +",dLable_Voc: "+argByPMPP.getLableVoc()+",dLable_Isc: "+argByPMPP.getLableIsc()+",dLable_Vmpp: "+argByPMPP.getLableVmpp()+",dLable_Impp: "+argByPMPP.getLableImpp());
|
||||
|
||||
|
||||
|
||||
//4. 把基板录到数据库
|
||||
WoPackagingBoxSubstrate woPackagingBoxSubstrate = new WoPackagingBoxSubstrate();
|
||||
woPackagingBoxSubstrate.setLineBody(lineNum);
|
||||
woPackagingBoxSubstrate.setPowerLevel(argByPMPP.getPowerClass());
|
||||
woPackagingBoxSubstrate.setSapMaterial(argByPMPP.getSapMaterialNum());
|
||||
woPackagingBoxSubstrate.setWoSubstrateId(subId);
|
||||
woPackagingBoxSubstrate.setActualPmpp(pmppActual);
|
||||
woPackagingBoxSubstrate.setCreateTime(LocalDateTime.now());
|
||||
woPackagingBoxSubstrate.setPmpp(pmppCompensation);
|
||||
|
||||
|
||||
//5. 从camline那里获取可变字段
|
||||
CamlineExtendArgDTO extendArgFromCamline = service.getExtendArgFromCamline(subId);
|
||||
logger.info("标签打印Event--- 基板ID: "+subId+", 从camline获取PID16~PID22 的实测数据 成功, 数据内容:"+extendArgFromCamline.toString());
|
||||
woPackagingBoxSubstrate.setLastUpdateTime(extendArgFromCamline.getLastUpdateTime());
|
||||
|
||||
woPackagingBoxSubstrate.setOrderName(extendArgFromCamline.getOrderName());
|
||||
woPackagingBoxSubstrate.setBinclassFl1(extendArgFromCamline.getBinclassFl1());
|
||||
woPackagingBoxSubstrate.setBinclassFl2(extendArgFromCamline.getBinclassFl2());
|
||||
woPackagingBoxSubstrate.setEtaFl1(extendArgFromCamline.getEtaFl1());
|
||||
woPackagingBoxSubstrate.setEtaFl2(extendArgFromCamline.getEtaFl2());
|
||||
woPackagingBoxSubstrate.setFfFl1(extendArgFromCamline.getFfFl1());
|
||||
woPackagingBoxSubstrate.setFfFl2(extendArgFromCamline.getFfFl2());
|
||||
woPackagingBoxSubstrate.setImppFl1(extendArgFromCamline.getImppFl1());
|
||||
woPackagingBoxSubstrate.setImppFl2(extendArgFromCamline.getImppFl2());
|
||||
woPackagingBoxSubstrate.setInsolflashcontrolFl1(extendArgFromCamline.getInsolflashcontrolFl1());
|
||||
woPackagingBoxSubstrate.setInsolflashcontrolFl2(extendArgFromCamline.getInsolflashcontrolFl2());
|
||||
woPackagingBoxSubstrate.setInsolmppFl1(extendArgFromCamline.getInsolmppFl1());
|
||||
woPackagingBoxSubstrate.setInsolmppFl2(extendArgFromCamline.getInsolmppFl2());
|
||||
woPackagingBoxSubstrate.setInsolvocFl1(extendArgFromCamline.getInsolvocFl1());
|
||||
woPackagingBoxSubstrate.setInsolvocFl2(extendArgFromCamline.getInsolvocFl2());
|
||||
woPackagingBoxSubstrate.setInsolFl1(extendArgFromCamline.getInsolFl1());
|
||||
woPackagingBoxSubstrate.setInsolFl2(extendArgFromCamline.getInsolFl2());
|
||||
woPackagingBoxSubstrate.setIscFl1(extendArgFromCamline.getIscFl1());
|
||||
woPackagingBoxSubstrate.setIscFl2(extendArgFromCamline.getIscFl2());
|
||||
woPackagingBoxSubstrate.setMeasTimeFl1(extendArgFromCamline.getMeasTimeFl1());
|
||||
woPackagingBoxSubstrate.setMeasTimeFl2(extendArgFromCamline.getMeasTimeFl2());
|
||||
woPackagingBoxSubstrate.setPmppFl1(extendArgFromCamline.getPmppFl1());
|
||||
woPackagingBoxSubstrate.setPmppFl2(extendArgFromCamline.getPmppFl2());
|
||||
woPackagingBoxSubstrate.setTcellFl1(extendArgFromCamline.getTcellFl1());
|
||||
woPackagingBoxSubstrate.setTcellFl2(extendArgFromCamline.getTcellFl2());
|
||||
woPackagingBoxSubstrate.setTmonicellFl1(extendArgFromCamline.getTmonicellFl1());
|
||||
woPackagingBoxSubstrate.setTmonicellFl2(extendArgFromCamline.getTmonicellFl2());
|
||||
woPackagingBoxSubstrate.setUmppFl1(extendArgFromCamline.getUmppFl1());
|
||||
woPackagingBoxSubstrate.setUmppFl2(extendArgFromCamline.getUmppFl2());
|
||||
woPackagingBoxSubstrate.setUocFl1(extendArgFromCamline.getUocFl1());
|
||||
woPackagingBoxSubstrate.setUocFl1(extendArgFromCamline.getUocFl2());
|
||||
|
||||
substrateServiceBiz.insert(woPackagingBoxSubstrate);
|
||||
logger.info("标签打印Event--- 基板ID: "+subId+", 录入数据库成功");
|
||||
//=============== MES 业务 结束 =================
|
||||
|
||||
//三. 当MES完成任务后,把MesToPlc.SubArrivedFinish变量置为true,告诉plc,我操作完成了
|
||||
write(S7Client.S7_KUKA,Step1Mes2PlcVar.SubArrivedFinish,true);
|
||||
logger.info("标签打印Event--- 基板ID: "+subId+", SubArrivedFinish,置为true 成功");
|
||||
//四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
|
||||
Integer subArrived2 = waitingForTarget(Step1Plc2MesVar.SubArrivedToMes, false);
|
||||
if(subArrived2 != 1){
|
||||
logger.info("标签打印Event--- 失败"+" --- "+"MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
|
||||
}
|
||||
|
||||
write(S7Client.S7_KUKA,Step1Mes2PlcVar.SubArrivedFinish,false);
|
||||
logger.info("标签打印Event--- 基板ID: "+subId+", SubArrivedFinish,置为 false 成功, Event1 成功结束");
|
||||
|
||||
}catch (Throwable e){
|
||||
logger.info("标签打印Event--- :"+e.getMessage());
|
||||
}
|
||||
}
|
||||
},1,1, TimeUnit.SECONDS);
|
||||
|
||||
kukaStep2.scheduleAtFixedRate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
//调度开始
|
||||
Integer shelfIsFull = waitingForTarget(Step2Plc2MesVar.ShelfIsFull, true);
|
||||
if(shelfIsFull != 1){
|
||||
logger.info("BOXID生成Event-------失败"+" --- "+"MES监听 Step2Plc2MesVar.ShelfIsFull 是否 等于 1 失败");
|
||||
}
|
||||
|
||||
//一. 从plc 中获取 subIdList 和 lineNum
|
||||
String[] subIdList = (String[])read(S7Client.S7_KUKA,Step2Plc2MesVar.SubIdList);
|
||||
Integer listSize = (Integer)read(S7Client.S7_KUKA,Step2Plc2MesVar.PackageNumberSet);
|
||||
|
||||
//二. MES 业务
|
||||
//=============== MES 业务 开始 =================
|
||||
//1.MES 生成BoxId
|
||||
if(subIdList.length<=0){
|
||||
logger.info("BOXID生成Event-------失败"+" --- "+"从plc里面获取到的基板列表 为空");
|
||||
throw new Exception("BOXID生成Event-------kuka机械手 取到了空箱");
|
||||
}
|
||||
//真实的基板ID 就是17位的,plc读取过来,有空格,要把后面3位空格去掉就行了。
|
||||
for(int i=0;i<subIdList.length;i++){
|
||||
subIdList[i] = removeKG(subIdList[i]);
|
||||
}
|
||||
logger.info("BOXID生成Event-------获取到基板列表:"+ Arrays.toString(subIdList)+",基板数量:"+listSize);
|
||||
|
||||
WoPackagingBoxSubstrate bySubId = substrateServiceBiz.getBySubId(subIdList[0]);
|
||||
//如果我们系统中找不到这块基板那么就去camline里面找
|
||||
if(bySubId == null){
|
||||
//todo
|
||||
CamlineSubIdDTO subIdByCamline = service.getSubIdByCamline(subIdList[0]);
|
||||
bySubId = new WoPackagingBoxSubstrate();
|
||||
bySubId.setPowerLevel(subIdByCamline.getPowerLevel());
|
||||
bySubId.setSapMaterial(subIdByCamline.getSapMaterial());
|
||||
bySubId.setLineBody(2);
|
||||
}
|
||||
|
||||
//校验是否存在混档位情况
|
||||
String boxId = "";
|
||||
if(isMixLevel(subIdList)){
|
||||
//出现混档
|
||||
boxId = getBoxId(bySubId.getSapMaterial());
|
||||
}else {
|
||||
//正常情况
|
||||
boxId = getErrorBoxId(bySubId.getSapMaterial());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
logger.info("BOXID生成Event-------mes 生成的boxId :"+ boxId);
|
||||
//2. 依次update 基板表,把boxId 赋予这些基板
|
||||
for(int i=0;i<listSize;i++){
|
||||
substrateServiceBiz.updatePackagingBoxIdAndSlotByWoSubstrateId(boxId,(i+1),subIdList[i]);
|
||||
}
|
||||
//3.去camline数据库 查询此基板ID 对应的订单
|
||||
String orderNameBySubId = service.getOrderNameBySubId(subIdList[0]);
|
||||
//4. box信息录入到box表
|
||||
WoPackagingBox woPackagingBox = new WoPackagingBox();
|
||||
woPackagingBox.setBoxNo(boxId);
|
||||
woPackagingBox.setSubstrateQuantity(listSize);
|
||||
woPackagingBox.setPackagingTime(LocalDateTime.now());
|
||||
woPackagingBox.setPowerLevel(bySubId.getPowerLevel());
|
||||
woPackagingBox.setLineBody(bySubId.getLineBody());
|
||||
woPackagingBox.setSapMaterial(bySubId.getSapMaterial());
|
||||
woPackagingBox.setOrderNum(orderNameBySubId);
|
||||
//1-手动模式,2-自动模式
|
||||
woPackagingBox.setModel(2);
|
||||
woPackagingBox.setCreateTime(LocalDateTime.now());
|
||||
boxServiceBiz.insert(woPackagingBox);
|
||||
logger.info("BOXID生成Event-------boxId :"+ boxId+"写入数据库成功");
|
||||
//=============== MES 业务 结束 =================
|
||||
|
||||
//三. 把生成的BoxId 告诉kuka
|
||||
write(S7Client.S7_KUKA,Step2Mes2PlcVar.BoxId,boxId);
|
||||
logger.info("BOXID生成Event-------boxId :"+ boxId+"传给PLC 成功");
|
||||
|
||||
//四. 当MES完成任务后,把MesToPlc.ShelfIsFullFinish变量置为true,告诉plc,我操作完成了
|
||||
write(S7Client.S7_KUKA,Step2Mes2PlcVar.ShelfIsFullFinish,true);
|
||||
logger.info("BOXID生成Event-------boxId :"+ boxId+"ShelfIsFullFinish 置为true 成功");
|
||||
//四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
|
||||
Integer subArrived2 = waitingForTarget(Step2Plc2MesVar.ShelfIsFull, false);
|
||||
if(subArrived2 != 1){
|
||||
logger.info("BOXID生成Event-------失败"+" --- "+"步骤1. MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
|
||||
}
|
||||
write(S7Client.S7_KUKA,Step2Mes2PlcVar.ShelfIsFullFinish,false);
|
||||
logger.info("BOXID生成Event-------boxId :"+ boxId+"ShelfIsFullFinish 置为false 成功,Event2 成功结束");
|
||||
}catch (Throwable e){
|
||||
logger.info("BOXID生成Event------- :" + e.getMessage());
|
||||
}
|
||||
}
|
||||
},1,1, TimeUnit.SECONDS);
|
||||
|
||||
kukaStep3.scheduleAtFixedRate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
//调度开始
|
||||
Integer shelfIsFull = waitingForTarget(Step3Plc2MesVar.ShelfIsFullArrived, true);
|
||||
if(shelfIsFull != 1){
|
||||
logger.info("装箱单打印Event------失败"+" --- "+"MES监听 Step3Plc2MesVar.ShelfIsFullArrived 是否 等于 1 失败");
|
||||
}
|
||||
|
||||
//一. 从plc 中获取 subIdList 和 lineNum
|
||||
String boxId = (String)read(S7Client.S7_KUKA,Step3Plc2MesVar.BoxId);
|
||||
Integer lineNum = (Integer) read(S7Client.S7_KUKA,Step3Plc2MesVar.LineNum);
|
||||
logger.info("装箱单打印Event------到达站台的boxId :"+boxId);
|
||||
|
||||
//二. MES 业务
|
||||
//=============== MES 业务 开始 =================
|
||||
//1. box信息录入到box表
|
||||
boxServiceBiz.updateIsArrivedByBoxNo(1,boxId);
|
||||
logger.info("装箱单打印Event------boxId :"+boxId+"更新数据库成功");
|
||||
//=============== MES 业务 结束 =================
|
||||
|
||||
|
||||
//四. 当MES完成任务后,把MesToPlc.ShelfIsFullArrivedFinish变量置为true,告诉plc,我操作完成了
|
||||
write(S7Client.S7_KUKA,Step3Mes2PlcVar.ShelfIsFullArrivedFinish,true);
|
||||
logger.info("装箱单打印Event------boxId :"+boxId+", ShelfIsFullArrivedFinish置为true 成功");
|
||||
//四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
|
||||
Integer subArrived2 = waitingForTarget(Step3Plc2MesVar.ShelfIsFullArrived, false);
|
||||
if(subArrived2 != 1){
|
||||
logger.info("装箱单打印Event------失败"+" --- "+"步骤1. MES监听 Step3Plc2MesVar.ShelfIsFullArrived 是否 等于 1 失败");
|
||||
}
|
||||
logger.info("装箱单打印Event------boxId :"+boxId+", 监听到subArrived=false 成功");
|
||||
write(S7Client.S7_KUKA,Step3Mes2PlcVar.ShelfIsFullArrivedFinish,false);
|
||||
logger.info("装箱单打印Event------boxId :"+boxId+", Even3 成功");
|
||||
}catch (Throwable e){
|
||||
logger.info("装箱单打印Event------"+e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
},1,1, TimeUnit.SECONDS);
|
||||
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ public class PrintModelController {
|
||||
@ApiImplicitParam(name = "name", value = "标签名称", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "type", value = "类型,0:模组标签,1:等级标签", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "lineBody", value = "线体,1=F ; 2=S", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "enabled", value = "启用状态:0 、停用,1、启用", paramType = "query", dataTypeClass = Integer.class)
|
||||
@ApiImplicitParam(name = "isEnable", value = "启用状态:0 、停用,1、启用", paramType = "query", dataTypeClass = Integer.class)
|
||||
})
|
||||
@PreAuthorize("@ex.hasAuthority('packing:printModel:page')")
|
||||
public Result<PageData<PrintModelDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
|
@ -168,4 +168,15 @@ public class WoPackagingBoxController {
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("editSubstrateManual")
|
||||
@ApiOperation("手动编辑包装箱")
|
||||
@LogOperation("手动编辑包装箱")
|
||||
public Result editSubstrateManual(@RequestBody WoPackagingBoxDTO dto){
|
||||
|
||||
woPackagingBoxService.editSubstrateManual(dto);
|
||||
|
||||
return new Result();
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -129,7 +129,7 @@ public class WoPackagingBoxSubstrateController {
|
||||
@PostMapping("/powerReport")
|
||||
public Result<PowerReportVo> powerReport(@RequestBody PowerReportQueryParam queryParam){
|
||||
List<PowerReportDTO> powerReportDTOS = boxServiceBiz.powerReport(queryParam);
|
||||
|
||||
System.out.println(powerReportDTOS.toString());
|
||||
PowerReportVo powerReportVo = new PowerReportVo();
|
||||
Float totalLevelPower = new Float(0);
|
||||
Float totalCompensatePower = new Float(0);
|
||||
@ -144,12 +144,12 @@ public class WoPackagingBoxSubstrateController {
|
||||
totalSubNum+= subNum;
|
||||
}
|
||||
for(PowerReportDTO power : powerReportDTOS){
|
||||
Float prop = Float.valueOf(power.getSubNum())/Float.valueOf(totalSubNum);
|
||||
Float prop = (Float.valueOf(power.getSubNum())/Float.valueOf(totalSubNum))*100;
|
||||
DecimalFormat df = new DecimalFormat("0.00");
|
||||
String propS = df.format(prop)+"%";
|
||||
power.setProportion(propS);
|
||||
}
|
||||
diversePower = totalLevelPower - totalCompensatePower;
|
||||
diversePower = totalCompensatePower - totalLevelPower;
|
||||
powerReportVo.setPowerReports(powerReportDTOS);
|
||||
powerReportVo.setDiversePower(diversePower);
|
||||
powerReportVo.setTotalCompensatePower(totalCompensatePower);
|
||||
|
@ -77,4 +77,7 @@ public class PrintModelDTO implements Serializable {
|
||||
@ApiModelProperty(value = "线体,1=F ; 2=S (用于过程1比对,和包装打印)(设备传给我们的)")
|
||||
private Integer lineBody;
|
||||
|
||||
@ApiModelProperty(value = "是否启用,0 停用;1 启用")
|
||||
private Integer isEnable;
|
||||
|
||||
}
|
@ -78,6 +78,9 @@ public class PrintModel implements Serializable {
|
||||
@ApiModelProperty("线体,1=F ; 2=S (用于过程1比对,和包装打印)(设备传给我们的)")
|
||||
private Integer lineBody;
|
||||
|
||||
@ApiModelProperty("是否启用,0 停用;1 启用")
|
||||
private Integer isEnable;
|
||||
|
||||
|
||||
public static final String ID = "ID";
|
||||
|
||||
@ -115,4 +118,6 @@ public class PrintModel implements Serializable {
|
||||
|
||||
public static final String LINE_BODY = "line_body";
|
||||
|
||||
public static final String IS_ENABLE = "is_enable";
|
||||
|
||||
}
|
||||
|
@ -52,5 +52,7 @@ public class PrintModelExcel {
|
||||
private String content;
|
||||
@Excel(name = "线体,1=F ; 2=S (用于过程1比对,和包装打印)(设备传给我们的)")
|
||||
private Integer lineBody;
|
||||
@Excel(name = "是否启用,0 停用;1 启用")
|
||||
private Integer isEnable;
|
||||
|
||||
}
|
@ -42,6 +42,8 @@ public interface WoPackagingBoxServiceBiz extends CrudService<WoPackagingBox, Wo
|
||||
|
||||
IdVo insertSubstrateManual(WoPackagingBoxDTO dto);
|
||||
|
||||
void editSubstrateManual(WoPackagingBoxDTO dto);
|
||||
|
||||
|
||||
int updateIsArrivedByBoxNo(Integer isArrived, String boxNo);
|
||||
|
||||
|
@ -47,9 +47,9 @@ public class PrintModelServiceBizImpl extends CrudServiceImpl<PrintModelMapper,
|
||||
Integer lineBody = Integer.parseInt(params.get("lineBody").toString());
|
||||
wrapper.eq(ObjectUtils.isNotNull(lineBody), PrintModel.LINE_BODY, lineBody);
|
||||
}
|
||||
if(params.get("enabled")!=null) {
|
||||
Integer enabled = Integer.parseInt(params.get("enabled").toString());
|
||||
wrapper.eq(ObjectUtils.isNotNull(enabled), PrintModel.ENABLED, enabled);
|
||||
if(params.get("isEnable")!=null) {
|
||||
Integer isEnable = Integer.parseInt(params.get("isEnable").toString());
|
||||
wrapper.eq(ObjectUtils.isNotNull(isEnable), PrintModel.IS_ENABLE, isEnable);
|
||||
}
|
||||
|
||||
return wrapper;
|
||||
|
@ -46,6 +46,11 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
|
||||
private WoPackagingBoxSubstrateServiceBiz woPackagingBoxSubstrateServiceBiz;
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
LocalDateTime localDate=LocalDateTime.parse("2023-03-23 09:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
System.out.println(localDate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryWrapper<WoPackagingBox> getWrapper(Map<String, Object> params){
|
||||
|
||||
@ -55,6 +60,8 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
|
||||
if(params.get("startTime")!=null && params.get("endTime")!=null){
|
||||
LocalDateTime startTime = LocalDateTime.parse(params.get("startTime").toString(),df);
|
||||
LocalDateTime endTime = LocalDateTime.parse(params.get("endTime").toString(),df);
|
||||
|
||||
|
||||
wrapper.between(startTime!=null && endTime!=null, WoPackagingBox.CREATE_TIME, startTime, endTime);
|
||||
}
|
||||
String boxNo = (String) params.get("boxNo");
|
||||
@ -189,6 +196,33 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
|
||||
return IdVo.builder().id(box.getId()).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void editSubstrateManual(WoPackagingBoxDTO dto) {
|
||||
//获取模组
|
||||
List<WoPackagingBoxSubstrate> substrateList = dto.getSubstrateList();
|
||||
for(WoPackagingBoxSubstrate substrate : substrateList){
|
||||
//新增:id为空 模组非空
|
||||
if(ObjectUtils.isEmpty(substrate.getId()) && StringUtils.isNotBlank(substrate.getWoSubstrateId())) {
|
||||
substrate.setPackagingBoxId(dto.getBoxNo());
|
||||
substrate.setPowerLevel(dto.getPowerLevel());
|
||||
substrate.setSapMaterial(dto.getSapMaterial());
|
||||
substrate.setLineBody(dto.getLineBody());
|
||||
BaseSupportUtils.setCommonField(substrate);
|
||||
woPackagingBoxSubstrateServiceBiz.insert(substrate);
|
||||
}
|
||||
//编辑:id非空 模组非空
|
||||
if(ObjectUtils.isNotEmpty(substrate.getId()) && StringUtils.isNotBlank(substrate.getWoSubstrateId())) {
|
||||
BaseSupportUtils.setUpdateCommonField(substrate);
|
||||
woPackagingBoxSubstrateServiceBiz.updateById(substrate);
|
||||
}
|
||||
//删除:id非空 模组为空
|
||||
if(ObjectUtils.isNotEmpty(substrate.getId()) && StringUtils.isBlank(substrate.getWoSubstrateId())) {
|
||||
woPackagingBoxSubstrateServiceBiz.deleteById(substrate.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateIsArrivedByBoxNo(Integer isArrived, String boxNo) {
|
||||
return mapper.updateIsArrivedByBoxNo(isArrived,boxNo);
|
||||
|
@ -12,9 +12,9 @@ import java.util.List;
|
||||
*/
|
||||
@Data
|
||||
public class PowerReportVo {
|
||||
private Float totalLevelPower;
|
||||
private Float totalCompensatePower;
|
||||
private Float diversePower;
|
||||
private Float totalLevelPower; //档位功率汇总
|
||||
private Float totalCompensatePower; //补偿功率汇总
|
||||
private Float diversePower; //差异功率汇总
|
||||
|
||||
private List<PowerReportDTO> powerReports;
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
<id column="IS_PREVIEW" property="isPreview" />
|
||||
<id column="CONTENT" property="content" />
|
||||
<id column="line_body" property="lineBody" />
|
||||
<id column="is_enable" property="isEnable" />
|
||||
</resultMap>
|
||||
|
||||
<select id="list" resultType="com.cnbm.packing.dto.PrintModelDTO">
|
||||
|
Loading…
Reference in New Issue
Block a user