liding
2025-04-11 804c80b0fd284c7464066efbd5e5833ddacfb635
原辅材下单优化
已修改2个文件
65 ■■■■ 文件已修改
basic-server/src/main/java/com/ruoyi/basic/service/impl/IfsInventoryQuantityServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListServiceImpl.java 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/service/impl/IfsInventoryQuantityServiceImpl.java
@@ -4,6 +4,8 @@
import com.ruoyi.basic.mapper.*;
import com.ruoyi.basic.pojo.*;
import com.ruoyi.basic.service.*;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.mapper.SysUserMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
@@ -16,8 +18,11 @@
    private IfsInventoryQuantityMapper ifsInventoryQuantityMapper;
    private SysUserMapper sysUserMapper;
    @Override
    public int addIfsInventory(IfsInventoryQuantity ifsInventoryQuantity) {
//        ifsInventoryQuantity.setDeclareUser(sysUserMapper.sel);
        ifsInventoryQuantity.setDeclareDate(LocalDateTime.now());
        if (ifsInventoryQuantity.getId() ==null){
            ifsInventoryQuantity.setState(0);
basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListServiceImpl.java
@@ -133,18 +133,54 @@
                                if (Objects.equals(a.getBsm(), "1")) {
                                    return true;
                                } else {
                                    if (sections.get(i).contains("&")) {
                                        String[] split = sections.get(i).split("&");
                                        isIf = getIsIf(split[0], modelNum, cores.get(i), conductorMaterials.get(i), conductorTypes.get(i), insSample)
                                                && getIsIf(split[1], modelNum, cores.get(i), conductorMaterials.get(i), conductorTypes.get(i), insSample);
                                    } else {
                                        isIf = getIsIf(sections.get(i), modelNum, cores.get(i), conductorMaterials.get(i), conductorTypes.get(i), insSample);
                                    int firstIndex = a.getTree().indexOf(" - ");
                                    String result2 = null;
                                    if (firstIndex != -1) {
                                        int secondIndex = a.getTree().indexOf(" - ", firstIndex + 3);
                                        if (secondIndex != -1) {
                                            int thirdIndex = a.getTree().indexOf(" - ", secondIndex + 3);
                                            if (thirdIndex != -1) {
                                                result2 = a.getTree().substring(secondIndex + 3, thirdIndex);
                                            }
                                        }
                                    }
                                    if (isIf) {
                                        a.setSection(sections.get(i));
                                        a.setAsk(asks.get(i));
                                        a.setTell(tells.get(i));
                                        return true;
                                    // 判断  原辅材  包材
                                    Set<String> targetStrings = new HashSet<>();
                                    targetStrings.add("原辅材");
                                    targetStrings.add("包材");
                                    boolean isType;
                                    isType = targetStrings.contains(result2);
                                    if (isType) {
                                        if (StringUtils.isNotEmpty(modelNum)){
                                            String currentSection = sections.get(i);
                                            String sectionValue = currentSection;
                                            int equalIndex = currentSection.indexOf("=");
                                            if (equalIndex != -1) {
                                                sectionValue = currentSection.substring(equalIndex + 1);
                                            }
                                            if (modelNum.equals(sectionValue)) {
                                                a.setSection(sections.get(i));
                                                a.setAsk(asks.get(i));
                                                a.setTell(tells.get(i));
                                                return true;
                                            }
                                        }else {
                                            return false;
                                        }
                                    } else {
                                        if (sections.get(i).contains("&")) {
                                            String[] split = sections.get(i).split("&");
                                            isIf = getIsIf(split[0], modelNum, cores.get(i), conductorMaterials.get(i), conductorTypes.get(i), insSample)
                                                    && getIsIf(split[1], modelNum, cores.get(i), conductorMaterials.get(i), conductorTypes.get(i), insSample);
                                        } else {
                                            isIf = getIsIf(sections.get(i), modelNum, cores.get(i), conductorMaterials.get(i), conductorTypes.get(i), insSample);
                                        }
                                        if (isIf) {
                                            a.setSection(sections.get(i));
                                            a.setAsk(asks.get(i));
                                            a.setTell(tells.get(i));
                                            return true;
                                        }
                                    }
                                }
                            }
@@ -213,7 +249,7 @@
            if (StringUtils.isNotEmpty(productPart.getInspectionItem())) {
                String inspectionItem = productPart.getInspectionItem();
                list = list.stream()
                        .filter(standardProductList -> inspectionItem.equals(standardProductList.getInspectionItem()))
                        .filter(standardProductList -> inspectionItem.contains(standardProductList.getInspectionItem()))
                        .collect(Collectors.toList());
            }
        }