Fancy
2024-08-20 745b115acbb46829eb52f904f0c276012decf938
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderSv.java
@@ -1,10 +1,12 @@
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.UserUtil;
@@ -57,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;