|
@@ -0,0 +1,98 @@
|
|
|
+package com.pj.project.tb_driver;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import com.pj.utils.sg.*;
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+
|
|
|
+ * 工具类:tb_driver -- 司机
|
|
|
+ * @author loovi
|
|
|
+ *
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class TbDriverUtil {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public static TbDriverMapper tbDriverMapper;
|
|
|
+ @Autowired
|
|
|
+ private void setTbDriverMapper(TbDriverMapper tbDriverMapper) {
|
|
|
+ TbDriverUtil.tbDriverMapper = tbDriverMapper;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * 将一个 TbDriver 对象进行进行数据完整性校验 (方便add/update等接口数据校验) [G]
|
|
|
+ */
|
|
|
+ static void check(TbDriver t) {
|
|
|
+ AjaxError.throwByIsNull(t.getId(), "[主键] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getName(), "[姓名] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getAge(), "[年龄] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getSex(), "[性别性别] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getPhone(), "[手机号] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getAddress(), "[联系地址] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getBankCode(), "[银行卡号] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getBankName(), "[银行名称] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getIdCard(), "[身份证号] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getIdCardImg(), "[身份证照片] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getDrivingLicenseId(), "[驾驶证号] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getDrivingLicenseImg(), "[驾驶证照片] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getVehicleDrivingId(), "[车辆行驶证号] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getVehicleDrivingImg(), "[车辆行驶证照片] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getVehicleImg(), "[车辆前脸照] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getRegisterTime(), "[注册时间] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getIsLock(), "[是否被锁定] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getCreateBy(), "[创建者id] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getCreateName(), "[创建者名称] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getCreateTime(), "[创建时间] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getUpdateBy(), "[更新者id] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getUpdateName(), "[更新者名称] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getUpdateTime(), "[更新时间] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getAuditStatus(), "[审核状态] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getAuditBy(), "[审核人] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getAuditTime(), "[审核时间] 不能为空");
|
|
|
+ AjaxError.throwByIsNull(t.getNopassReason(), "[审核不通过原因] 不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 获取一个TbDriver (方便复制代码用) [G]
|
|
|
+ */
|
|
|
+ static TbDriver getTbDriver() {
|
|
|
+ TbDriver t = new TbDriver();
|
|
|
+ t.setId(0L);
|
|
|
+ t.setName("");
|
|
|
+ t.setAge(0);
|
|
|
+ t.setSex("");
|
|
|
+ t.setPhone("");
|
|
|
+ t.setAddress("");
|
|
|
+ t.setBankCode("");
|
|
|
+ t.setBankName("");
|
|
|
+ t.setIdCard("");
|
|
|
+ t.setIdCardImg("");
|
|
|
+ t.setDrivingLicenseId("");
|
|
|
+ t.setDrivingLicenseImg("");
|
|
|
+ t.setVehicleDrivingId("");
|
|
|
+ t.setVehicleDrivingImg("");
|
|
|
+ t.setVehicleImg("");
|
|
|
+ t.setRegisterTime("");
|
|
|
+ t.setIsLock("");
|
|
|
+ t.setCreateBy("");
|
|
|
+ t.setCreateName("");
|
|
|
+ t.setCreateTime(new Date());
|
|
|
+ t.setUpdateBy("");
|
|
|
+ t.setUpdateName("");
|
|
|
+ t.setUpdateTime(new Date());
|
|
|
+ t.setAuditStatus(0);
|
|
|
+ t.setAuditBy("");
|
|
|
+ t.setAuditTime("");
|
|
|
+ t.setNopassReason("");
|
|
|
+ return t;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|