| | |
| | | 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.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.app.dto.OrderListDto; |
| | |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.dao.*; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.system.hive.plugin.util.MoneyUtil; |
| | | import com.matrix.system.hive.pojo.CzXkVo; |
| | | import com.matrix.system.hive.pojo.ShoppingCarItem; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpSession; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @date 2016-07-03 20:53 |
| | |
| | | sysOrder.setStaffId(source != null ? source.getStaffId() : user.getSuId()); |
| | | sysOrder.setCompanyId(source != null ? source.getCompanyId() : user.getCompanyId()); |
| | | |
| | | sysOrder.setPayTime(new Date()); |
| | | |
| | | if (sysOrder.getId() == null) { |
| | | //新增订单 |
| | | sysOrder.setOrderNo(codeService.getOrderCode()); |
| | |
| | | |
| | | /** |
| | | * 取消订单 |
| | | * 本方法无法退回多次不同卡项收款的订单 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | AchieveNew achieveNew = new AchieveNew(); |
| | | achieveNew.setOrderId(id); |
| | | achieveNewService.removeByModel(achieveNew); |
| | | |
| | | // 删除收款记录 |
| | | sysOrderFlowDao.deleteByOrderId(id); |
| | | |
| | | // 取消订单 |
| | | order.setStatu(Dictionary.ORDER_STATU_YQX); |
| | | |
| | |
| | | orderStatus = Dictionary.ORDER_STATU_TK; |
| | | } |
| | | // 更新收款状态 |
| | | sourceOrder.setPayTime(new Date()); |
| | | sourceOrder.setStatu(orderStatus); |
| | | sourceOrder.setCardPay(cardPayTotal); |
| | | sourceOrder.setCashPay(cashPayTotal); |
| | |
| | | ShoppingGoods sysGoods = shoppingGoodsDao.selectById(outStoreItem.getSkuId()); |
| | | if (sysGoods != null) { |
| | | throw new GlobleException("出库失败:【" + sysGoods.getName() + "库存不足】"); |
| | | |
| | | } else { |
| | | throw new GlobleException("出库失败没有找到出库产品"); |
| | | } |
| | |
| | | puse.setVipId(order.getVipId()); |
| | | puse.setStatus(Dictionary.TAOCAN_STATUS_YX); |
| | | puse.setType(Dictionary.SHOPPING_GOODS_TYPE_XM); |
| | | puse.setBalance(MoneyUtil.add(sysOrderItem.getCardPay(), sysOrderItem.getCashPay())); |
| | | puse.setBalance(sysOrderItem.getZkPrice()); |
| | | puse.setPrice(sysOrderItem.getZkPrice()); |
| | | puse.setProjName(sysOrderItem.getShoppingGoods().getName()); |
| | | // 赠送和打折后金额为0的都视为赠送项目 |
| | |
| | | orderItem.setIsFree(Dictionary.FLAG_NO); |
| | | orderItem.setPrice(czVo.getBjmoney()); |
| | | orderItem.setStatus(Dictionary.ORDER_STATU_YFK); |
| | | orderItem.setAchaeveList(czVo.getAchaeveList()); |
| | | orderItem.setAchieveList(czVo.getAchaeveList()); |
| | | orderItemDao.insert(orderItem); |
| | | List<SysOrderItem> items = new ArrayList<>(); |
| | | items.add(orderItem); |