| | |
| | | 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; |
| | |
| | | |
| | | @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; |