value
2024-05-14 eb1a57285bb3468a4efe051781b8cc7a13ec23c6
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
@@ -11,6 +11,7 @@
import com.yuanchu.mom.pojo.StandardProductList;
import com.yuanchu.mom.pojo.StandardTree;
import com.yuanchu.mom.service.StandardProductListService;
import com.yuanchu.mom.service.StandardProductListService2;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
@@ -37,6 +38,8 @@
    private GetLook getLook;
    private StandardProductListService2 standardProductListService2;
    @Override
    public int upStandardProductList(StandardProductList list) {
        return standardProductListMapper.updateById(list);
@@ -49,7 +52,7 @@
    @Override
    public List<StandardProductList> selectStandardProductList(InsSample insSample) {
        String[] models = insSample.getModel().split("-");
        String[] models = insSample.getModel().split("-(?=[^-]*$)");//拆分最后一个【-】
        List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId()).eq(StandardProductList::getState, 1).eq(StandardProductList::getModel, models[0]));
        list = list.stream().filter(a -> {
            try {
@@ -127,7 +130,7 @@
                        && Objects.equals(sp.getInspectionItemSubclass(), pl.getInspectionItemSubclass())
                        && Objects.equals(sp.getModel(), pl.getModel())) {
                    pl.setId(sp.getId());
                    pl.setState(sp.getState());
                    pl.setState(id==0?1:sp.getState());
                    pl.setMethodS(sp.getMethodS());
                    if(sp.getAsk()!=null&&!sp.getAsk().equals("")){
                        pl.setAsk(sp.getAsk());
@@ -144,6 +147,9 @@
                    if(sp.getSection()!=null&&!sp.getSection().equals("")){
                        pl.setSection(sp.getSection());
                    }
                    if(sp.getTemplateId()!=null&&!sp.getTemplateId().equals("")){
                        pl.setTemplateId(sp.getTemplateId());
                    }
                    break;
                }
            }
@@ -151,7 +157,7 @@
        Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId");
        CompletableFuture.supplyAsync(() -> {
            standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id).like(StandardProductList::getTree, tree));
            saveBatch(list.stream().map(a->{
            standardProductListService2.saveBatch(list.stream().map(a->{
                a.setFactory(trees[0]);
                a.setLaboratory(trees[1]);
                a.setSampleType(trees[2]);