| | |
| | | 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()); |
| | |
| | | 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的都视为赠送项目 |