田源
2024-09-29 d8f51c40544ae278095e991ed00ec297842d4332
Merge remote-tracking branch 'origin/master'
已修改5个文件
98 ■■■■ 文件已修改
Source/UBCS-WEB/src/views/docking/loge.vue 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeBasicSec.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/poi/util/ExcelUtil.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeBasicSecServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/docking/loge.vue
@@ -174,24 +174,24 @@
            overHidden: true,
            width: 140
          },
          {
            label: '标准申请',
            prop: 'applyCodeForBZ',
            sortable:true,
            width: 130
          },
          {
            label: '部门申请',
            prop: 'syncDataForOrg',
            sortable:true,
            width: 130
          },
          {
            label: '人员申请',
            prop: 'syncDataForPerson',
            sortable:true,
            width: 130
          },
          // {
          //   label: '标准申请',
          //   prop: 'applyCodeForBZ',
          //   sortable:true,
          //   width: 130
          // },
          // {
          //   label: '部门申请',
          //   prop: 'syncDataForOrg',
          //   sortable:true,
          //   width: 130
          // },
          // {
          //   label: '人员申请',
          //   prop: 'syncDataForPerson',
          //   sortable:true,
          //   width: 130
          // },
          {
            label: '集成系统编号',
            prop: 'systemCode',
@@ -217,7 +217,6 @@
            prop:'paramString',
            sortable:true,
            minRows: 20,
            width: 150,
            type: "textarea",
            slot: true,
            hide:true,
@@ -227,7 +226,6 @@
            prop:'returnString',
            sortable:true,
            minRows: 20,
            width: 150,
            type: "textarea",
            slot: true,
            hide:true,
@@ -235,14 +233,13 @@
          {
            label: '返回msg',
            prop: 'msg',
            width: 150,
            overHidden: true
          },
          {
            label: '记录时间',
            prop: 'createTime',
            sortable:true,
            width: 160
          },
          {
            label: '是否成功',
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeBasicSec.java
@@ -237,7 +237,6 @@
     */
    private String customCodeSerialClass;
    /**
     * 自定义的流水算法类
     */
@@ -291,7 +290,7 @@
    private String displayFlag;
    /**
     * 流水依赖顺序
     * 流水依赖顺序 TODO:本来是用来计算流水排序的,后面因为某些原因改用orderNum了
     */
    private Integer serialDependOrder;
Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/poi/util/ExcelUtil.java
@@ -19,7 +19,6 @@
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.hssf.util.HSSFColor.HSSFColorPredefined;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellRangeAddressList;
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeBasicSecServiceImpl.java
@@ -1069,7 +1069,8 @@
            .eq(CodeBasicSec::getPkCodeRule,codeRuleOid)
            .in(CodeBasicSec::getOid,codeBasicSecOidList)
            .eq(CodeBasicSec::getSerialDependFlag,"true")
            .orderByAsc(CodeBasicSec::getSerialDependOrder);
            //TODO: SerialDependOrder本来是用来流水排序的,但是现在的逻辑是按照orderuNum排序的
            .orderByAsc(CodeBasicSec::getOrderNum); //.orderByAsc(CodeBasicSec::getSerialDependOrder);
        List<CodeBasicSec> codeBasicSecList = this.list(wrapper);
        //按流水依赖顺序,处理流水依赖码段的值
@@ -1149,7 +1150,8 @@
            .eq(CodeBasicSec::getPkCodeRule,codeRuleOid)
            .in(CodeBasicSec::getOid,codeBasicSecOidList)
            .eq(CodeBasicSec::getSerialDependFlag,"true")
            .orderByAsc(CodeBasicSec::getSerialDependOrder);
            .orderByAsc(CodeBasicSec::getOrderNum); //.orderByAsc(CodeBasicSec::getSerialDependOrder);
        List<CodeBasicSec> codeBasicSecList = this.list(wrapper);
        //按流水依赖顺序,处理流水依赖码段的值
        List<String> serialDependValueList = new ArrayList<>();
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java
@@ -51,6 +51,7 @@
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
@@ -117,7 +118,7 @@
                //VciBaseUtil.setCurrentUserSessionInfo(sessionInfo);
                String code = cbo.getId();
                List<String> serialUnitList = new CopyOnWriteArrayList<>();
                String seclenghStr=cbo.getData().get(CODE_SEC_LENGTH_FIELD);
                //String seclenghStr=cbo.getData().get(CODE_SEC_LENGTH_FIELD);
                String[] secLengths = cbo.getData().get(CODE_SEC_LENGTH_FIELD).split("#");
                cbo.getData().remove(CODE_SEC_LENGTH_FIELD);//将此key除去
                cbo.getData().remove(IMPORT_ROW_INDEX);//将此key除去
@@ -136,11 +137,11 @@
                        //最后
                        thisSecValue =  seclenghStr.contains("#")?code.substring(VciBaseUtil.getInt(secLengths[i-1]),code.length()):code;
                    }else {*/
                        int start = 0;
                        for (int j = 0; j < i; j++) {
                            start += VciBaseUtil.getInt(secLengths[j]);
                        }
                        thisSecValue = code.substring(start,start+VciBaseUtil.getInt(secLengths[i]));
                    int start = 0;
                    for (int j = 0; j < i; j++) {
                        start += VciBaseUtil.getInt(secLengths[j]);
                    }
                    thisSecValue = code.substring(start,start+VciBaseUtil.getInt(secLengths[i]));
                    //    }
                    if(VciBaseUtil.getBoolean(secVO.getSerialDependFlag())){
                        serialUnitList.add(thisSecValue);
@@ -154,7 +155,7 @@
                List<String> serialUnFileStringList = new ArrayList<>();
                AtomicReference<String> newSerialUnitString = new AtomicReference<>("");
                if(!CollectionUtils.isEmpty(serialValueMap)){
                    AtomicInteger index= new AtomicInteger();
                    AtomicInteger index = new AtomicInteger();
                    serialValueMap.forEach((secOid,secValue)->{
                        //要看是不是补位的
                        CodeBasicSecVO secVO = secVOMap.get(secOid);
@@ -175,7 +176,7 @@
                        if(OsCodeFillTypeEnum.NONE.getValue().equalsIgnoreCase(secVO.getCodeFillType())){
                            //不补码
                            //把所有不是数字的去掉,因为可能会是老数据,新规则
                            //    serialDb = VciBaseUtil.getDouble(killUnNumberChar(subSecValue));
                            //serialDb = VciBaseUtil.getDouble(killUnNumberChar(subSecValue));
                            //serialDb = killUnNumberChar(subSecValue);
                            serialDb=subSecValue;
                        }else {
@@ -183,21 +184,24 @@
                            serialDb = killFillChar(subSecValue,secVO.getCodeFillSeparator(),
                                OsCodeFillTypeEnum.LEFT.getValue().equalsIgnoreCase(secVO.getCodeFillType()));
                        }
                        Double newSerialDb= CustomSerialEnum.getDoubleCustomSerialValue(serialDb,secVO.getCustomCodeSerialType());
                        HashMap<String, String> thisUnitMaxMap = maxSerialMap.getOrDefault(serialUnitString, new HashMap<>());
                        Double maxValue=newSerialDb;
                        if(thisUnitMaxMap.containsKey(secOid)){
                            String     newMaxValue=  thisUnitMaxMap.getOrDefault(secOid,"");
                            maxValue=StringUtils.isBlank(newMaxValue)?-1:VciBaseUtil.getDouble(newMaxValue);
                            if(maxValue<newSerialDb){
                                maxValue=newSerialDb;
                        Double newSerialDb = CustomSerialEnum.getDoubleCustomSerialValue(serialDb,secVO.getCustomCodeSerialType());
                        //TODO: 20240822需要这块代码是同步性的,maxSerialMap这儿会因为线程受影响,修改后测试多次总数为5000条一次导入耗费时间为3分30秒左右
                        synchronized(this) {
                            HashMap<String, String> thisUnitMaxMap = maxSerialMap.getOrDefault(serialUnitString, new HashMap<>());
                            Double maxValue=newSerialDb;
                            if(thisUnitMaxMap.containsKey(secOid)){
                                String newMaxValue = thisUnitMaxMap.getOrDefault(secOid,"");
                                maxValue = StringUtils.isBlank(newMaxValue)?-1:VciBaseUtil.getDouble(newMaxValue);
                                if(maxValue < newSerialDb){
                                    maxValue = newSerialDb;
                                }
                            }
                            String newMaxValue=CustomSerialEnum.getStringCustomSerialValue(maxValue,secVO.getCustomCodeSerialType());
                            serialDb=CustomSerialEnum.getStringCustomSerialValue(newSerialDb,secVO.getCustomCodeSerialType());
                            thisUnitMaxMap.put(secOid,newMaxValue);
                            maxSerialMap.put(serialUnitString,thisUnitMaxMap);
                            serialUnFileStringList.add(String.valueOf(serialDb));
                        }
                        String newMaxValue=CustomSerialEnum.getStringCustomSerialValue(maxValue,secVO.getCustomCodeSerialType());
                        serialDb=CustomSerialEnum.getStringCustomSerialValue(newSerialDb,secVO.getCustomCodeSerialType());
                        thisUnitMaxMap.put(secOid,newMaxValue);
                        maxSerialMap.put(serialUnitString,thisUnitMaxMap);
                        serialUnFileStringList.add(String.valueOf(serialDb));
                    });
                }
                CodeAllCode allCodeDO = new CodeAllCode();
@@ -273,7 +277,6 @@
                        allCodeWrapper.in("id", QueryOptionConstant.IN + "(" +
                            VciBaseUtil.toInSql(codeDOs.stream().map(s->s.getId()).collect(Collectors.toList()).toArray(new String[0])) + ")");
                        List<CodeAllCode> existCodes = codeAllCodeService.selectByWrapper(allCodeWrapper);
                        if(!CollectionUtils.isEmpty(existCodes)){
                            existCodes.stream().forEach(existCode->{