|
@@ -0,0 +1,215 @@
|
|
|
|
+package com.iotechn.unimall.app.api.pinche.impl;
|
|
|
|
+
|
|
|
|
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.mapper.Wrapper;
|
|
|
|
+import com.iotechn.unimall.app.api.pinche.IPincheVehicleFilingAppService;
|
|
|
|
+import com.iotechn.unimall.core.exception.ServiceException;
|
|
|
|
+import com.iotechn.unimall.data.domain.PincheVehicleFiling;
|
|
|
|
+import com.iotechn.unimall.data.mapper.PincheVehicleFilingMapper;
|
|
|
|
+import com.iotechn.unimall.data.model.Page;
|
|
|
|
+import com.iotechn.unimall.data.util.ExcelUtil;
|
|
|
|
+import org.apache.ibatis.session.RowBounds;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
+
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 司机认证Service业务层处理
|
|
|
|
+ *
|
|
|
|
+ * @author jlb
|
|
|
|
+ * @date 2023-02-17
|
|
|
|
+ */
|
|
|
|
+@Service
|
|
|
|
+public class PincheVehicleFilingAppServiceImpl implements IPincheVehicleFilingAppService {
|
|
|
|
+ @Autowired
|
|
|
|
+ private PincheVehicleFilingMapper pincheVehicleFilingMapper;
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Boolean add(PincheVehicleFiling pincheVehicleFiling, Long adminId) throws ServiceException {
|
|
|
|
+ Date now = new Date();
|
|
|
|
+ pincheVehicleFiling.setStatus("待管理员审核");
|
|
|
|
+ pincheVehicleFiling.setGmtCreate(now);
|
|
|
|
+ pincheVehicleFiling.setGmtUpdate(now);
|
|
|
|
+ pincheVehicleFiling.setAdminId(adminId);
|
|
|
|
+ return pincheVehicleFilingMapper.insert(pincheVehicleFiling) > 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Page<PincheVehicleFiling> list(Long companyId, String dept, String driverName, String phone, String employeeNo, String carNo, String pinpai, String color, String jiashiben, String xingshiben, String status, String remark1, String remark2, String remark3, Long deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
|
|
|
|
+ Wrapper<PincheVehicleFiling> wrapper = new EntityWrapper<PincheVehicleFiling>();
|
|
|
|
+ if (!StringUtils.isEmpty(companyId)) {
|
|
|
|
+ wrapper.eq("company_id", companyId);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(dept)) {
|
|
|
|
+ wrapper.eq("dept", dept);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(driverName)) {
|
|
|
|
+ wrapper.eq("driver_name", driverName);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(phone)) {
|
|
|
|
+ wrapper.eq("phone", phone);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(employeeNo)) {
|
|
|
|
+ wrapper.eq("employee_no", employeeNo);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(carNo)) {
|
|
|
|
+ wrapper.eq("car_no", carNo);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(pinpai)) {
|
|
|
|
+ wrapper.eq("pinpai", pinpai);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(color)) {
|
|
|
|
+ wrapper.eq("color", color);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(jiashiben)) {
|
|
|
|
+ wrapper.eq("jiashiben", jiashiben);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(xingshiben)) {
|
|
|
|
+ wrapper.eq("xingshiben", xingshiben);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(status)) {
|
|
|
|
+ wrapper.eq("status", status);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(remark1)) {
|
|
|
|
+ wrapper.eq("remark1", remark1);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(remark2)) {
|
|
|
|
+ wrapper.eq("remark2", remark2);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(remark3)) {
|
|
|
|
+ wrapper.eq("remark3", remark3);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(deleteFlag)) {
|
|
|
|
+ wrapper.eq("delete_flag", deleteFlag);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(gmtCreate)) {
|
|
|
|
+ wrapper.eq("gmt_create", gmtCreate);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(gmtUpdate)) {
|
|
|
|
+ wrapper.eq("gmt_update", gmtUpdate);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(userId)) {
|
|
|
|
+ wrapper.eq("user_id", userId);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(adminId)) {
|
|
|
|
+ wrapper.eq("admin_id", adminId);
|
|
|
|
+ }
|
|
|
|
+ wrapper.eq("delete_flag", 0);
|
|
|
|
+ List<PincheVehicleFiling> list = pincheVehicleFilingMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
|
|
|
|
+ Integer count = pincheVehicleFilingMapper.selectCount(wrapper);
|
|
|
|
+ return new Page<PincheVehicleFiling>(list, page, limit, count);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public Boolean delete(String id) {
|
|
|
|
+ String[] ids = String.valueOf(id).split(",");
|
|
|
|
+ for (String tt : ids) {
|
|
|
|
+ PincheVehicleFiling tmp = pincheVehicleFilingMapper.selectById(Long.parseLong(tt));
|
|
|
|
+ if (tmp != null) {
|
|
|
|
+ tmp.setDeleteFlag(1l);
|
|
|
|
+ pincheVehicleFilingMapper.updateById(tmp);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Boolean update(PincheVehicleFiling pincheVehicleFiling, Long adminId) throws ServiceException {
|
|
|
|
+ Date now = new Date();
|
|
|
|
+ pincheVehicleFiling.setStatus("待管理员审核");
|
|
|
|
+ pincheVehicleFiling.setGmtUpdate(now);
|
|
|
|
+ pincheVehicleFiling.setAdminId(adminId);
|
|
|
|
+ return pincheVehicleFilingMapper.updateById(pincheVehicleFiling) > 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Boolean audit(PincheVehicleFiling pincheVehicleFiling, Long adminId) throws ServiceException {
|
|
|
|
+ PincheVehicleFiling pincheVehicleFiling1 = pincheVehicleFilingMapper.selectById(pincheVehicleFiling.getId());
|
|
|
|
+ if("1".equals(pincheVehicleFiling.getFlag())){
|
|
|
|
+ pincheVehicleFiling1.setStatus("审核通过");
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ pincheVehicleFiling1.setStatus("审核未通过");
|
|
|
|
+ }
|
|
|
|
+ Date now = new Date();
|
|
|
|
+ pincheVehicleFiling1.setGmtUpdate(now);
|
|
|
|
+ pincheVehicleFiling1.setAdminId(adminId);
|
|
|
|
+ return pincheVehicleFilingMapper.updateById(pincheVehicleFiling1) > 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public PincheVehicleFiling get(Long id) throws ServiceException {
|
|
|
|
+ return pincheVehicleFilingMapper.selectById(id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public String export(Long companyId, String dept, String driverName, String phone, String employeeNo, String carNo, String pinpai, String color, String jiashiben, String xingshiben, String status, String remark1, String remark2, String remark3, Long deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
|
|
|
|
+ Wrapper<PincheVehicleFiling> wrapper = new EntityWrapper<PincheVehicleFiling>();
|
|
|
|
+ if (!StringUtils.isEmpty(companyId)) {
|
|
|
|
+ wrapper.eq("company_id", companyId);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(dept)) {
|
|
|
|
+ wrapper.eq("dept", dept);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(driverName)) {
|
|
|
|
+ wrapper.eq("driver_name", driverName);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(phone)) {
|
|
|
|
+ wrapper.eq("phone", phone);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(employeeNo)) {
|
|
|
|
+ wrapper.eq("employee_no", employeeNo);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(carNo)) {
|
|
|
|
+ wrapper.eq("car_no", carNo);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(pinpai)) {
|
|
|
|
+ wrapper.eq("pinpai", pinpai);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(color)) {
|
|
|
|
+ wrapper.eq("color", color);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(jiashiben)) {
|
|
|
|
+ wrapper.eq("jiashiben", jiashiben);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(xingshiben)) {
|
|
|
|
+ wrapper.eq("xingshiben", xingshiben);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(status)) {
|
|
|
|
+ wrapper.eq("status", status);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(remark1)) {
|
|
|
|
+ wrapper.eq("remark1", remark1);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(remark2)) {
|
|
|
|
+ wrapper.eq("remark2", remark2);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(remark3)) {
|
|
|
|
+ wrapper.eq("remark3", remark3);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(deleteFlag)) {
|
|
|
|
+ wrapper.eq("delete_flag", deleteFlag);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(gmtCreate)) {
|
|
|
|
+ wrapper.eq("gmt_create", gmtCreate);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(gmtUpdate)) {
|
|
|
|
+ wrapper.eq("gmt_update", gmtUpdate);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(userId)) {
|
|
|
|
+ wrapper.eq("user_id", userId);
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(adminId)) {
|
|
|
|
+ wrapper.eq("admin_id", adminId);
|
|
|
|
+ }
|
|
|
|
+ List<PincheVehicleFiling> list = pincheVehicleFilingMapper.selectList(wrapper);
|
|
|
|
+ ExcelUtil<PincheVehicleFiling> util = new ExcelUtil<PincheVehicleFiling>(PincheVehicleFiling.class);
|
|
|
|
+ return util.exportExcel(list, "操作日志");
|
|
|
|
+ }
|
|
|
|
+}
|