Fancy
2024-08-21 40ce2548e631d4971e3fdf9f9c692857312c0b16
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderSv.java
@@ -1,18 +1,17 @@
package com.dy.pmsProduct.order;
import cn.hutool.core.codec.Base64;
import com.dy.common.webFilter.UserTokenContext;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.daoOth.OthFileMapper;
import com.dy.pmsGlobal.daoPr.*;
import com.dy.pmsGlobal.dyFile.FileOperate;
import com.dy.pmsGlobal.pojoBa.BaUser;
import com.dy.pmsGlobal.pojoPlt.PltProduct;
import com.dy.pmsGlobal.pojoPr.*;
import com.dy.pmsGlobal.util.QrCodeUtil;
import com.dy.pmsGlobal.util.UserUtil;
import com.dy.pmsProduct.process.QueryVo;
import com.google.zxing.WriterException;
import com.dy.pmsProduct.order.QueryVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -60,10 +59,16 @@
    @Transactional
    public int save(PrOrder p) {
        p.id = null;
        //判断产品不能重名
        if (orderDao.exists(p.name, p.id)) {
            throw new RuntimeException("订单名称不能重复");
        }
        p.setDeleted(false);
        BaUser loginUser = userUtil.getUser(UserTokenContext.get());
        if(loginUser!=null){
            p.creator = loginUser.id;
        }
        int count = orderDao.insertSelective(p);
        saveOrderItems(p);
        return count;