|
@@ -0,0 +1,144 @@
|
|
|
+package com.pj.tb_order;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import com.pj.utils.sg.*;
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+
|
|
|
+ * 工具类:tb_order -- 订单表
|
|
|
+ * @author loovi
|
|
|
+ *
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class TbOrderUtil {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public static TbOrderMapper tbOrderMapper;
|
|
|
+ @Autowired
|
|
|
+ private void setTbOrderMapper(TbOrderMapper tbOrderMapper) {
|
|
|
+ TbOrderUtil.tbOrderMapper = tbOrderMapper;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * 将一个 TbOrder 对象进行进行数据完整性校验 (方便add/update等接口数据校验) [G]
|
|
|
+ */
|
|
|
+ static void check(TbOrder t) {
|
|
|
+ AjaxError.throwByIsNull(t.getId(), "[主键] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getTradeAreaId(), "[] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getTradeAreaName(), "[] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getAddressIds(), "[] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getSaleMainId(), "[] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getTradeNo(), "[订单号] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getBuyUserId(), "[买家ID] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getBuyUserName(), "[买家] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getBuyUserType(), "[购买用户类型] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getEnterpriseId(), "[商家ID] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getEnterpriseName(), "[商家名称] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getTotalWeight(), "[总重量] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getTotalPrice(), "[总金额] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getTradeTime(), "[交易时间] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getTradeStatus(), "[交易状态] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getPayType(), "[支付方式] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getSettleTime(), "[结算时间] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getRealPrice(), "[当前结算金额] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getShouldPrice(), "[应结金额] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getSettleUserId(), "[对账人] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getRecordUserId(), "[对账人员] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getRecordTime(), "[对账时间] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getRecord(), "[是否对账] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getRefundReason(), "[退款原因] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getRefundTime(), "[退款时间] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getReceiveName(), "[] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getReceivePhone(), "[] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getReceiveAddress(), "[] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getOutTime(), "[出互市区时间] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getGoodsNames(), "[商品名称字符串] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getApply(), "[是否申报] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getApplyTime(), "[申报时间] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getApplyResult(), "[申报结果] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getApplyFailReason(), "[] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getDistribution(), "[分配方式] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getConfirm(), "[是否确认] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getPick(), "[是否接单] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getPickTime(), "[接单时间] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getShopId(), "[] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getShopName(), "[] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getSend(), "[是否发货] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getSendTime(), "[发货时间] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getLevelTwoOrderId(), "[对应二级市场中的收购单ID] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getCreateTime(), "[创建时间] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getCreateBy(), "[创建人编号] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getCreateName(), "[创建人名称] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getUpdateTime(), "[更新时间] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getUpdateBy(), "[更新人编号] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getUpdateName(), "[更新人名称] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getDeleteStatus(), "[删除状态] 不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 获取一个TbOrder (方便复制代码用) [G]
|
|
|
+ */
|
|
|
+ static TbOrder getTbOrder() {
|
|
|
+ TbOrder t = new TbOrder();
|
|
|
+ t.setId(0L);
|
|
|
+ t.setTradeAreaId(0L);
|
|
|
+ t.setTradeAreaName("");
|
|
|
+ t.setAddressIds("");
|
|
|
+ t.setSaleMainId(0L);
|
|
|
+ t.setTradeNo("");
|
|
|
+ t.setBuyUserId(0L);
|
|
|
+ t.setBuyUserName("");
|
|
|
+ t.setBuyUserType("");
|
|
|
+ t.setEnterpriseId(0L);
|
|
|
+ t.setEnterpriseName("");
|
|
|
+ t.setTotalWeight(0.0);
|
|
|
+ t.setTotalPrice(0.0);
|
|
|
+ t.setTradeTime(new Date());
|
|
|
+ t.setTradeStatus("");
|
|
|
+ t.setPayType("");
|
|
|
+ t.setSettleTime("");
|
|
|
+ t.setRealPrice(0.0);
|
|
|
+ t.setShouldPrice(0.0);
|
|
|
+ t.setSettleUserId(0L);
|
|
|
+ t.setRecordUserId(0L);
|
|
|
+ t.setRecordTime("");
|
|
|
+ t.setRecord("");
|
|
|
+ t.setRefundReason("");
|
|
|
+ t.setRefundTime("");
|
|
|
+ t.setReceiveName("");
|
|
|
+ t.setReceivePhone("");
|
|
|
+ t.setReceiveAddress("");
|
|
|
+ t.setOutTime("");
|
|
|
+ t.setGoodsNames("");
|
|
|
+ t.setApply("");
|
|
|
+ t.setApplyTime("");
|
|
|
+ t.setApplyResult("");
|
|
|
+ t.setApplyFailReason("");
|
|
|
+ t.setDistribution("");
|
|
|
+ t.setConfirm("");
|
|
|
+ t.setPick("");
|
|
|
+ t.setPickTime("");
|
|
|
+ t.setShopId(0L);
|
|
|
+ t.setShopName("");
|
|
|
+ t.setSend("");
|
|
|
+ t.setSendTime("");
|
|
|
+ t.setLevelTwoOrderId(0L);
|
|
|
+ t.setCreateTime("");
|
|
|
+ t.setCreateBy("");
|
|
|
+ t.setCreateName("");
|
|
|
+ t.setUpdateTime("");
|
|
|
+ t.setUpdateBy("");
|
|
|
+ t.setUpdateName("");
|
|
|
+ t.setDeleteStatus(0);
|
|
|
+ return t;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|