whycxzp
2023-07-04 4e0147ac43533a4dc99f86d443618a4959c28162
src/main/java/com/whyc/service/ProductHistoryService.java
@@ -8,6 +8,7 @@
import com.whyc.mapper.ProductBomMapper;
import com.whyc.mapper.ProductHistoryMapper;
import com.whyc.mapper.ProductMapper;
import com.whyc.pojo.Material;
import com.whyc.pojo.Product;
import com.whyc.pojo.ProductHistory;
import com.whyc.pojo.ProductLockLog;
@@ -135,6 +136,23 @@
            //设为不可用版本为-1
            uWrapper.set("version",-1);
            productMapper.update(null,uWrapper);
            //4.查询产品是否存在物料时钣金件的产品
            Material material_0120=productMapper.selectMaterial_0120(parentCode,customCode);
            //如果存在则锁定
            if(material_0120!=null){
                //先锁定历史
                UpdateWrapper wrapperHistory_0120=new UpdateWrapper();
                wrapperHistory_0120.eq("parent_code",material_0120.getSubCode());
                wrapperHistory_0120.set("enabled",0);
                mapper.update(null,wrapperHistory_0120);
                //再设置实时为-1
                UpdateWrapper wrapper_0120=new UpdateWrapper();
                wrapper_0120.eq("parent_code",material_0120.getSubCode());
                //设为不可用版本为-1
                wrapper_0120.set("version",-1);
                productMapper.update(null,wrapper_0120);
            }
            /*if(flag>0){
                //
                QueryWrapper qWrapper=new QueryWrapper();