| | |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | |
| | | |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.bean.SysOutStore; |
| | | import com.matrix.system.hive.bean.SysOutStoreItem; |
| | | import com.matrix.system.hive.bean.SysShopInfo; |
| | | import com.matrix.system.hive.bean.SysStoreInfo; |
| | | import com.matrix.system.hive.dao.SysOutStoreDao; |
| | | import com.matrix.system.hive.dao.SysOutStoreItemDao; |
| | | import com.matrix.system.hive.dao.SysStoreInfoDao; |
| | | import com.matrix.system.hive.service.CodeService; |
| | | import com.matrix.system.hive.service.SysOutStoreService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | |
| | | /** |
| | | * @date 2016-07-25 12:43 |
| | |
| | | private SysStoreInfoDao storeInfoDao; |
| | | @Autowired |
| | | private CodeService codeService; |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 取消出库单 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public int checkInfo(SysOutStore sysOutStore) { |
| | | public void cancelOutStore(Long id) { |
| | | List<SysOutStoreItem> outStoreItemList = sysOutStoreItemDao.selectByOrderId(id); |
| | | for (SysOutStoreItem item : outStoreItemList) { |
| | | SysStoreInfo sysStoreInfo = storeInfoDao.selectById(item.getStoreId()); |
| | | sysStoreInfo.setStoreTotal(sysStoreInfo.getStoreTotal() + item.getAmount()); |
| | | //更新库存 |
| | | storeInfoDao.update(sysStoreInfo); |
| | | } |
| | | sysOutStoreDao.deleteById(id); |
| | | sysOutStoreItemDao.deleteByOrderId(id); |
| | | } |
| | | |
| | | @Override |
| | | public int effectOutStore(SysOutStore sysOutStore) { |
| | | |
| | | SysOutStore queryStore = sysOutStoreDao.selectById(sysOutStore.getId()); |
| | | |
| | | if(!queryStore.getCheckStatus().equals(Dictionary.CHECK_STATUS_DSH)){ |
| | | throw new GlobleException("单据状态已更新,请刷新"); |
| | | } |
| | | |
| | | List<SysOutStoreItem> list = queryStore.getOutStoreItems(); |
| | | int flag = 0; |
| | | for (SysOutStoreItem item : list) { |