Browse Source

update

tags/v0
zhaohe 9 months ago
parent
commit
58147550db
  1. 7
      src/main/java/a8k/service/app/appctrl/AppConsumablesScanService.java
  2. 8
      src/main/java/a8k/service/app/appdata/ProjCfgMgrService.java
  3. 2
      src/main/java/a8k/service/app/appdata/ReactionRecordMgrService.java
  4. 10
      src/main/java/a8k/service/app/appstate/ConsumablesMgrService.java
  5. 2
      src/main/java/a8k/service/db/A8kProjIdCardDBService.java
  6. 1
      src/main/java/a8k/service/db/AppSettingDBService.java
  7. 4
      src/main/java/a8k/service/db/type/A8kIdCardInfo.java
  8. 3
      src/main/java/a8k/service/test/fakeproj/FakeProjInfo.java
  9. 6
      src/main/java/a8k/type/consumables/ConsumableState.java
  10. 6
      src/main/java/a8k/type/consumables/LarBSGroup.java
  11. 6
      src/main/java/a8k/type/consumables/LittBSGroup.java
  12. 8
      src/main/java/a8k/type/consumables/ReactionPlateGroup.java
  13. 2
      src/main/java/a8k/utils/A8kIdCardDataParser.java
  14. BIN
      src/main/resources/app.db

7
src/main/java/a8k/service/app/appctrl/AppConsumablesScanService.java

@ -22,7 +22,6 @@ import a8k.utils.ReactionPlate2DCodeHelper;
import a8k.utils.ZStringUtils; import a8k.utils.ZStringUtils;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.Assert; import org.springframework.util.Assert;
@ -101,7 +100,7 @@ public class AppConsumablesScanService {
Assert.isTrue(projCfg.projectInfo.reactionFlowType != null, "reactionType != null"); Assert.isTrue(projCfg.projectInfo.reactionFlowType != null, "reactionType != null");
Integer projIndex = projCfg.idCardInfo.projIndex;
Integer projIndex = projCfg.idCardInfo.projId;
A8kReactionFlowType reactionType = projCfg.projectInfo.reactionFlowType; A8kReactionFlowType reactionType = projCfg.projectInfo.reactionFlowType;
if (reactionType.equals(A8kReactionFlowType.FlowType1)) { if (reactionType.equals(A8kReactionFlowType.FlowType1)) {
//校验小瓶缓冲液,小瓶缓冲液+样本 //校验小瓶缓冲液,小瓶缓冲液+样本
@ -159,10 +158,10 @@ public class AppConsumablesScanService {
cState.reactionPlateGroup[ch] = new ReactionPlateGroup(result.projIndex, a8kIdCardInfo.projName, projInfo.projShortName, result.lotId, a8kIdCardInfo.color, AppConstant.CONSUMABLE_NUM); cState.reactionPlateGroup[ch] = new ReactionPlateGroup(result.projIndex, a8kIdCardInfo.projName, projInfo.projShortName, result.lotId, a8kIdCardInfo.color, AppConstant.CONSUMABLE_NUM);
if (reactionType.equals(A8kReactionFlowType.FlowType1)) { if (reactionType.equals(A8kReactionFlowType.FlowType1)) {
cState.littBSGroup[ch] = new LittBSGroup(result.projIndex, a8kIdCardInfo.projName, projInfo.projShortName, result.lotId, a8kIdCardInfo.color, AppConstant.CONSUMABLE_NUM);
cState.littBottleGroup[ch] = new LittBSGroup(result.projIndex, a8kIdCardInfo.projName, projInfo.projShortName, result.lotId, a8kIdCardInfo.color, AppConstant.CONSUMABLE_NUM);
cState.larBSGroup[ch] = new LarBSGroup(); cState.larBSGroup[ch] = new LarBSGroup();
} else if (reactionType.equals(A8kReactionFlowType.FlowType2)) { } else if (reactionType.equals(A8kReactionFlowType.FlowType2)) {
cState.littBSGroup[ch] = new LittBSGroup(result.projIndex, a8kIdCardInfo.projName, projInfo.projShortName, result.lotId, a8kIdCardInfo.color, AppConstant.CONSUMABLE_NUM);
cState.littBottleGroup[ch] = new LittBSGroup(result.projIndex, a8kIdCardInfo.projName, projInfo.projShortName, result.lotId, a8kIdCardInfo.color, AppConstant.CONSUMABLE_NUM);
cState.larBSGroup[ch] = new LarBSGroup(result.projIndex, a8kIdCardInfo.projName, projInfo.projShortName, result.lotId, a8kIdCardInfo.color, AppConstant.CONSUMABLE_NUM); cState.larBSGroup[ch] = new LarBSGroup(result.projIndex, a8kIdCardInfo.projName, projInfo.projShortName, result.lotId, a8kIdCardInfo.color, AppConstant.CONSUMABLE_NUM);
} else { } else {
throw new RuntimeException("未知的反应流程类型"); throw new RuntimeException("未知的反应流程类型");

8
src/main/java/a8k/service/app/appdata/ProjCfgMgrService.java

@ -31,8 +31,8 @@ public class ProjCfgMgrService {
if(projCfg.idCardInfo == null){ if(projCfg.idCardInfo == null){
return projCfg; return projCfg;
} }
projCfg.projectInfo = a8kProjInfoDBService.findByProjIndex(projCfg.idCardInfo.projIndex);
projCfg.projOptConfigList = a8kProjOptConfigDBService.findByProjIndex(projCfg.idCardInfo.projIndex);
projCfg.projectInfo = a8kProjInfoDBService.findByProjIndex(projCfg.idCardInfo.projId);
projCfg.projOptConfigList = a8kProjOptConfigDBService.findByProjIndex(projCfg.idCardInfo.projId);
return projCfg; return projCfg;
} }
@ -40,9 +40,9 @@ public class ProjCfgMgrService {
A8kProjCfg projCfg = new A8kProjCfg(); A8kProjCfg projCfg = new A8kProjCfg();
projCfg.idCardInfo = a8kProjIdCardDBService.getByLotId(lotid); projCfg.idCardInfo = a8kProjIdCardDBService.getByLotId(lotid);
Assert.isTrue(projCfg.idCardInfo != null, "ID卡信息不存在"); Assert.isTrue(projCfg.idCardInfo != null, "ID卡信息不存在");
projCfg.projectInfo = a8kProjInfoDBService.findByProjIndex(projCfg.idCardInfo.projIndex);
projCfg.projectInfo = a8kProjInfoDBService.findByProjIndex(projCfg.idCardInfo.projId);
Assert.isTrue(projCfg.projectInfo != null, "项目信息不存在"); Assert.isTrue(projCfg.projectInfo != null, "项目信息不存在");
projCfg.projOptConfigList = a8kProjOptConfigDBService.findByProjIndex(projCfg.idCardInfo.projIndex);
projCfg.projOptConfigList = a8kProjOptConfigDBService.findByProjIndex(projCfg.idCardInfo.projId);
Assert.isTrue(projCfg.projOptConfigList != null, "项目配置信息不存在"); Assert.isTrue(projCfg.projOptConfigList != null, "项目配置信息不存在");
return projCfg; return projCfg;
} }

2
src/main/java/a8k/service/app/appdata/ReactionRecordMgrService.java

@ -56,7 +56,7 @@ public class ReactionRecordMgrService {
record.sampleId = projContext.sampleId; record.sampleId = projContext.sampleId;
record.projName = projContext.projInfo.projName; record.projName = projContext.projInfo.projName;
record.lotId = projContext.projCfg.idCardInfo.lotId; record.lotId = projContext.projCfg.idCardInfo.lotId;
record.projIndex = projContext.projCfg.idCardInfo.projIndex;
record.projIndex = projContext.projCfg.idCardInfo.projId;
record.expiryDate = projContext.projCfg.idCardInfo.expiryDate; record.expiryDate = projContext.projCfg.idCardInfo.expiryDate;
record.operator = operator; record.operator = operator;
record.projShortName = projContext.projInfo.projShortName; record.projShortName = projContext.projInfo.projShortName;

10
src/main/java/a8k/service/app/appstate/ConsumablesMgrService.java

@ -46,7 +46,7 @@ public class ConsumablesMgrService {
Integer total = 0; Integer total = 0;
var cState = gstate.getConsumableState(); var cState = gstate.getConsumableState();
for (int i = 0; i < cState.reactionPlateGroup.length; i++) { for (int i = 0; i < cState.reactionPlateGroup.length; i++) {
if (cState.reactionPlateGroup[i].projIndex.equals(projIndex)) {
if (cState.reactionPlateGroup[i].projId.equals(projIndex)) {
total += cState.reactionPlateGroup[i].num; total += cState.reactionPlateGroup[i].num;
} }
} }
@ -70,7 +70,7 @@ public class ConsumablesMgrService {
synchronized ConsumableGroup priGetConsumableGroupByProjIndex(Integer projIndex) { synchronized ConsumableGroup priGetConsumableGroupByProjIndex(Integer projIndex) {
var cState = gstate.getConsumableState(); var cState = gstate.getConsumableState();
for (int i = 0; i < cState.reactionPlateGroup.length; i++) { for (int i = 0; i < cState.reactionPlateGroup.length; i++) {
if (cState.reactionPlateGroup[i].projIndex.equals(projIndex)) {
if (cState.reactionPlateGroup[i].projId.equals(projIndex)) {
if (cState.reactionPlateGroup[i].num > 0) { if (cState.reactionPlateGroup[i].num > 0) {
return ConsumableGroup.fromInt(i); return ConsumableGroup.fromInt(i);
} }
@ -82,8 +82,8 @@ public class ConsumablesMgrService {
synchronized void priSetConsumableGroupNum(ConsumableGroup group, Integer num) { synchronized void priSetConsumableGroupNum(ConsumableGroup group, Integer num) {
var cState = gstate.getConsumableState(); var cState = gstate.getConsumableState();
cState.reactionPlateGroup[group.off].num = num; cState.reactionPlateGroup[group.off].num = num;
if (cState.littBSGroup[group.off].enable) {
cState.littBSGroup[group.off].num = num;
if (cState.littBottleGroup[group.off].enable) {
cState.littBottleGroup[group.off].num = num;
} }
if (cState.larBSGroup[group.off].enable) { if (cState.larBSGroup[group.off].enable) {
cState.larBSGroup[group.off].num = num; cState.larBSGroup[group.off].num = num;
@ -109,7 +109,7 @@ public class ConsumablesMgrService {
synchronized Integer priGetProjIndex(ConsumableGroup group) { synchronized Integer priGetProjIndex(ConsumableGroup group) {
var cState = gstate.getConsumableState(); var cState = gstate.getConsumableState();
return cState.reactionPlateGroup[group.off].projIndex;
return cState.reactionPlateGroup[group.off].projId;
} }
// //

2
src/main/java/a8k/service/db/A8kProjIdCardDBService.java

@ -66,7 +66,7 @@ public class A8kProjIdCardDBService {
updateIdCard(idcardinfo); updateIdCard(idcardinfo);
return; return;
} }
idcardinfo.color = colorAllocer.getProjColor(idcardinfo.projIndex);
idcardinfo.color = colorAllocer.getProjColor(idcardinfo.projId);
ZSqliteJdbcHelper.addObj(jdbcTemplate, tableName, tClass, idcardinfo); ZSqliteJdbcHelper.addObj(jdbcTemplate, tableName, tClass, idcardinfo);
} }

1
src/main/java/a8k/service/db/AppSettingDBService.java

@ -35,6 +35,7 @@ public class AppSettingDBService {
void init() { void init() {
if (!ZSqliteJdbcHelper.isTableExist(jdbcTemplate, tableName)) { if (!ZSqliteJdbcHelper.isTableExist(jdbcTemplate, tableName)) {
ZSqliteJdbcHelper.createTable(jdbcTemplate, tableName, tClass); ZSqliteJdbcHelper.createTable(jdbcTemplate, tableName, tClass);
ZSqliteJdbcHelper.addObj(jdbcTemplate, tableName, AppSetting.class, new AppSetting());
} }
} }

4
src/main/java/a8k/service/db/type/A8kIdCardInfo.java

@ -16,7 +16,7 @@ public class A8kIdCardInfo {
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
public Date expiryDate; // 有效日期 0x001C public Date expiryDate; // 有效日期 0x001C
public Integer projIndex; // 项目名称代码 0x001F
public Integer projId; // 项目名称代码 0x001F
public Integer palteCode; // 板条条码代码 0x0020 public Integer palteCode; // 板条条码代码 0x0020
public Integer updateChipVersion; // 更新芯片版本号 0x0021 public Integer updateChipVersion; // 更新芯片版本号 0x0021
@ -67,7 +67,7 @@ public class A8kIdCardInfo {
breif.projName = projName; breif.projName = projName;
breif.lotId = lotId; breif.lotId = lotId;
breif.expiryDate = expiryDate; breif.expiryDate = expiryDate;
breif.projIndex = projIndex;
breif.projIndex = projId;
breif.palteCode = palteCode; breif.palteCode = palteCode;
breif.updateChipVersion = updateChipVersion; breif.updateChipVersion = updateChipVersion;
return breif; return breif;

3
src/main/java/a8k/service/test/fakeproj/FakeProjInfo.java

@ -5,7 +5,6 @@ import a8k.service.db.type.ProjOptConfig;
import a8k.service.db.type.A8kProjectInfo; import a8k.service.db.type.A8kProjectInfo;
import a8k.service.db.type.a8kidcard.zenum.A8kOptType; import a8k.service.db.type.a8kidcard.zenum.A8kOptType;
import a8k.service.db.type.a8kidcard.zenum.A8kReactionFlowType; import a8k.service.db.type.a8kidcard.zenum.A8kReactionFlowType;
import a8k.type.OptScanDirection;
import a8k.utils.ZDateUtils; import a8k.utils.ZDateUtils;
import java.util.ArrayList; import java.util.ArrayList;
@ -51,7 +50,7 @@ public class FakeProjInfo {
} else { } else {
idCardInfo.expiryDate = ZDateUtils.theDayBeforeYesterday(); idCardInfo.expiryDate = ZDateUtils.theDayBeforeYesterday();
} }
idCardInfo.projIndex = projIndex;
idCardInfo.projId = projIndex;
idCardInfo.updateChipVersion = updateChipVersion; idCardInfo.updateChipVersion = updateChipVersion;
idCardInfo.subProjNum = subProjNum; idCardInfo.subProjNum = subProjNum;
return idCardInfo; return idCardInfo;

6
src/main/java/a8k/type/consumables/ConsumableState.java

@ -12,7 +12,7 @@ public class ConsumableState {
public Tips[] tips = new Tips[3]; public Tips[] tips = new Tips[3];
public ReactionPlateGroup[] reactionPlateGroup = new ReactionPlateGroup[6]; public ReactionPlateGroup[] reactionPlateGroup = new ReactionPlateGroup[6];
public LittBSGroup[] littBSGroup = new LittBSGroup[6];
public LittBSGroup[] littBottleGroup = new LittBSGroup[6];
public LarBSGroup[] larBSGroup = new LarBSGroup[6]; public LarBSGroup[] larBSGroup = new LarBSGroup[6];
public ConsumableState() { public ConsumableState() {
@ -23,8 +23,8 @@ public class ConsumableState {
for (int i = 0; i < reactionPlateGroup.length; i++) { for (int i = 0; i < reactionPlateGroup.length; i++) {
reactionPlateGroup[i] = new ReactionPlateGroup(); reactionPlateGroup[i] = new ReactionPlateGroup();
} }
for (int i = 0; i < littBSGroup.length; i++) {
littBSGroup[i] = new LittBSGroup();
for (int i = 0; i < littBottleGroup.length; i++) {
littBottleGroup[i] = new LittBSGroup();
} }
for (int i = 0; i < larBSGroup.length; i++) { for (int i = 0; i < larBSGroup.length; i++) {
larBSGroup[i] = new LarBSGroup(); larBSGroup[i] = new LarBSGroup();

6
src/main/java/a8k/type/consumables/LarBSGroup.java

@ -1,7 +1,7 @@
package a8k.type.consumables; package a8k.type.consumables;
public class LarBSGroup { public class LarBSGroup {
public Integer projIndex; //项目ID
public Integer projId; //项目ID
public String projName; //项目名称 public String projName; //项目名称
public String projShortName;//项目缩写名称 public String projShortName;//项目缩写名称
public String lotId = ""; //批次号 public String lotId = ""; //批次号
@ -12,8 +12,8 @@ public class LarBSGroup {
public LarBSGroup() { public LarBSGroup() {
} }
public LarBSGroup(Integer projIndex, String projName, String projShortName, String lotId, String color, Integer num) {
this.projIndex = projIndex;
public LarBSGroup(Integer projId, String projName, String projShortName, String lotId, String color, Integer num) {
this.projId = projId;
this.projName = projName; this.projName = projName;
this.projShortName = projShortName; this.projShortName = projShortName;
this.lotId = lotId; this.lotId = lotId;

6
src/main/java/a8k/type/consumables/LittBSGroup.java

@ -1,7 +1,7 @@
package a8k.type.consumables; package a8k.type.consumables;
public class LittBSGroup { public class LittBSGroup {
public Integer projIndex; //项目ID
public Integer projId; //项目ID
public String projName; //项目名称 public String projName; //项目名称
public String projShortName;//项目缩写名称 public String projShortName;//项目缩写名称
public String lotId = ""; //批次号 public String lotId = ""; //批次号
@ -13,8 +13,8 @@ public class LittBSGroup {
enable = false; enable = false;
} }
public LittBSGroup(Integer projIndex, String projName, String projShortName, String lotId, String color, Integer num) {
this.projIndex = projIndex;
public LittBSGroup(Integer projId, String projName, String projShortName, String lotId, String color, Integer num) {
this.projId = projId;
this.projName = projName; this.projName = projName;
this.projShortName = projShortName; this.projShortName = projShortName;
this.lotId = lotId; this.lotId = lotId;

8
src/main/java/a8k/type/consumables/ReactionPlateGroup.java

@ -1,20 +1,20 @@
package a8k.type.consumables; package a8k.type.consumables;
public class ReactionPlateGroup { public class ReactionPlateGroup {
public Integer projIndex; //项目ID
public Integer projId; //项目ID
public String projName; //项目名称 public String projName; //项目名称
public String projShortName;//项目缩写名称 public String projShortName;//项目缩写名称
public String lotId = ""; //批次号 public String lotId = ""; //批次号
public String color = ""; //颜色 public String color = ""; //颜色
public Boolean enable = false;
// public Boolean enable = false;
public Integer num = 0; public Integer num = 0;
public ReactionPlateGroup() { public ReactionPlateGroup() {
} }
public ReactionPlateGroup(Integer projIndex, String projName, String projShortName, String lotId, String color, Integer num) {
this.projIndex = projIndex;
public ReactionPlateGroup(Integer projId, String projName, String projShortName, String lotId, String color, Integer num) {
this.projId = projId;
this.projName = projName; this.projName = projName;
this.projShortName = projShortName; this.projShortName = projShortName;
this.lotId = lotId; this.lotId = lotId;

2
src/main/java/a8k/utils/A8kIdCardDataParser.java

@ -24,7 +24,7 @@ public class A8kIdCardDataParser {
idCardInfo.projName = parseAsString("idcard.projectName ", 0x0001, 15); idCardInfo.projName = parseAsString("idcard.projectName ", 0x0001, 15);
idCardInfo.lotId = parseAsString("idcard.lotName ", 0x0010, 12); idCardInfo.lotId = parseAsString("idcard.lotName ", 0x0010, 12);
idCardInfo.expiryDate = parseAsDate("idcard.expiryDate ", 0x001C); idCardInfo.expiryDate = parseAsDate("idcard.expiryDate ", 0x001C);
idCardInfo.projIndex = parseAsByte("idcard.projectCode ", 0x001F);
idCardInfo.projId = parseAsByte("idcard.projectCode ", 0x001F);
idCardInfo.palteCode = parseAsByte("idcard.palteCode ", 0x0020); idCardInfo.palteCode = parseAsByte("idcard.palteCode ", 0x0020);
idCardInfo.updateChipVersion = parseAsByte("idcard.updateChipVersion ", 0x0021); idCardInfo.updateChipVersion = parseAsByte("idcard.updateChipVersion ", 0x0021);

BIN
src/main/resources/app.db

Loading…
Cancel
Save