Browse Source

Merge branch 'master' of http://git.zthymaoyi.com/gongdc/pinche

achao 2 years ago
parent
commit
317a97a174

+ 92 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/pinche/IPincheCarSharingAppService.java

@@ -0,0 +1,92 @@
+package com.iotechn.unimall.app.api.pinche;
+
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.PincheCarSharing;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+/**
+ * 发布信息Service接口
+ * 
+ * @author jlb
+ * @date 2022-11-30
+ */
+@HttpOpenApi(group = "pincheCarSharingApp", description = "发布信息")
+public interface IPincheCarSharingAppService {
+	@HttpMethod(description = "新增")
+	public Boolean add(@NotNull @HttpParam(name = "pincheCarSharing", type = HttpParamType.COMMON, description = "发布信息") PincheCarSharing pincheCarSharing,
+						   @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId)throws ServiceException;
+
+	@HttpMethod(description = "列表")
+	public Page<PincheCarSharing> list(
+								@HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+							@HttpParam(name = "carpoolingType", type = HttpParamType.COMMON, description = "拼车类型") String carpoolingType,
+							@HttpParam(name = "route", type = HttpParamType.COMMON, description = "路线") String route,
+							@HttpParam(name = "phone", type = HttpParamType.COMMON, description = "手机号") String phone,
+							@HttpParam(name = "startPlace", type = HttpParamType.COMMON, description = "出发地点") String startPlace,
+							@HttpParam(name = "endPlace", type = HttpParamType.COMMON, description = "到达地点") String endPlace,
+							@HttpParam(name = "departureLatitude", type = HttpParamType.COMMON, description = "出发经纬度") String departureLatitude,
+							@HttpParam(name = "latitudeArrival", type = HttpParamType.COMMON, description = "到达经纬度") String latitudeArrival,
+							@HttpParam(name = "departureTime", type = HttpParamType.COMMON, description = "出发时间") Date departureTime,
+							@HttpParam(name = "numberPeople", type = HttpParamType.COMMON, description = "人数") String numberPeople,
+							@HttpParam(name = "explain", type = HttpParamType.COMMON, description = "说明") String explain,
+							@HttpParam(name = "unitPrice", type = HttpParamType.COMMON, description = "单价") Double unitPrice,
+							@HttpParam(name = "price", type = HttpParamType.COMMON, description = "总价") Double price,
+							@HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+							@HttpParam(name = "remark1", type = HttpParamType.COMMON, description = "备注1") String remark1,
+							@HttpParam(name = "remark2", type = HttpParamType.COMMON, description = "备注2") String remark2,
+							@HttpParam(name = "remark3", type = HttpParamType.COMMON, description = "备注3") String remark3,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Long deleteFlag,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+							@HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改")
+	public Boolean update(@NotNull @HttpParam(name = "pincheCarSharing", type = HttpParamType.COMMON, description = "发布信息") PincheCarSharing pincheCarSharing,
+						  @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId)throws ServiceException;
+
+	@HttpMethod(description = "查询")
+	public PincheCarSharing get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表", permission = "admin:unimall:pincheCarSharing:export",permissionParentName = "宠物管理", permissionName = "发布信息管理")
+	public String export(
+								@HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+							@HttpParam(name = "carpoolingType", type = HttpParamType.COMMON, description = "拼车类型") String carpoolingType,
+							@HttpParam(name = "route", type = HttpParamType.COMMON, description = "路线") String route,
+							@HttpParam(name = "phone", type = HttpParamType.COMMON, description = "手机号") String phone,
+							@HttpParam(name = "startPlace", type = HttpParamType.COMMON, description = "出发地点") String startPlace,
+							@HttpParam(name = "endPlace", type = HttpParamType.COMMON, description = "到达地点") String endPlace,
+							@HttpParam(name = "departureLatitude", type = HttpParamType.COMMON, description = "出发经纬度") String departureLatitude,
+							@HttpParam(name = "latitudeArrival", type = HttpParamType.COMMON, description = "到达经纬度") String latitudeArrival,
+							@HttpParam(name = "departureTime", type = HttpParamType.COMMON, description = "出发时间") Date departureTime,
+							@HttpParam(name = "numberPeople", type = HttpParamType.COMMON, description = "人数") String numberPeople,
+							@HttpParam(name = "explain", type = HttpParamType.COMMON, description = "说明") String explain,
+							@HttpParam(name = "unitPrice", type = HttpParamType.COMMON, description = "单价") Double unitPrice,
+							@HttpParam(name = "price", type = HttpParamType.COMMON, description = "总价") Double price,
+							@HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+							@HttpParam(name = "remark1", type = HttpParamType.COMMON, description = "备注1") String remark1,
+							@HttpParam(name = "remark2", type = HttpParamType.COMMON, description = "备注2") String remark2,
+							@HttpParam(name = "remark3", type = HttpParamType.COMMON, description = "备注3") String remark3,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Long deleteFlag,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+							@HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 94 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/pinche/IPincheMakeAppointmentAppService.java

@@ -0,0 +1,94 @@
+package com.iotechn.unimall.app.api.pinche;
+
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.PincheMakeAppointment;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+/**
+ * 预约信息Service接口
+ * 
+ * @author jlb
+ * @date 2022-11-30
+ */
+@HttpOpenApi(group = "pincheMakeAppointmentApp", description = "预约信息")
+public interface IPincheMakeAppointmentAppService {
+	@HttpMethod(description = "新增")
+	public Boolean add(@NotNull @HttpParam(name = "pincheMakeAppointment") PincheMakeAppointment pincheMakeAppointment,
+						   @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId)throws ServiceException;
+
+	@HttpMethod(description = "列表")
+	public Page<PincheMakeAppointment> list(
+								@HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+							@HttpParam(name = "appointedBy", type = HttpParamType.COMMON, description = "预约人") String appointedBy,
+							@HttpParam(name = "carpoolingType", type = HttpParamType.COMMON, description = "拼车类型") String carpoolingType,
+							@HttpParam(name = "route", type = HttpParamType.COMMON, description = "路线") String route,
+							@HttpParam(name = "phone", type = HttpParamType.COMMON, description = "手机号") String phone,
+							@HttpParam(name = "startPlace", type = HttpParamType.COMMON, description = "出发地点") String startPlace,
+							@HttpParam(name = "endPlace", type = HttpParamType.COMMON, description = "到达地点") String endPlace,
+							@HttpParam(name = "departureLatitude", type = HttpParamType.COMMON, description = "出发经纬度") String departureLatitude,
+							@HttpParam(name = "latitudeArrival", type = HttpParamType.COMMON, description = "到达经纬度") String latitudeArrival,
+							@HttpParam(name = "departureTime", type = HttpParamType.COMMON, description = "出发时间") Date departureTime,
+							@HttpParam(name = "numberPeople", type = HttpParamType.COMMON, description = "人数") String numberPeople,
+							@HttpParam(name = "explain", type = HttpParamType.COMMON, description = "说明") String explain,
+							@HttpParam(name = "unitPrice", type = HttpParamType.COMMON, description = "单价") Double unitPrice,
+							@HttpParam(name = "price", type = HttpParamType.COMMON, description = "总价") Double price,
+							@HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+							@HttpParam(name = "remark1", type = HttpParamType.COMMON, description = "备注1") String remark1,
+							@HttpParam(name = "remark2", type = HttpParamType.COMMON, description = "备注2") String remark2,
+							@HttpParam(name = "remark3", type = HttpParamType.COMMON, description = "备注3") String remark3,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Long deleteFlag,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+							@HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除", permission = "admin:unimall:pincheMakeAppointment:delete",permissionParentName = "宠物管理", permissionName = "预约信息管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改", permission = "admin:unimall:pincheMakeAppointment:update",permissionParentName = "宠物管理", permissionName = "预约信息管理")
+	public Boolean update(@NotNull @HttpParam(name = "pincheMakeAppointment", type = HttpParamType.COMMON, description = "预约信息") PincheMakeAppointment pincheMakeAppointment,
+						  @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId)throws ServiceException;
+
+	@HttpMethod(description = "查询", permission = "admin:unimall:pincheMakeAppointment:get",permissionParentName = "宠物管理", permissionName = "预约信息管理")
+	public PincheMakeAppointment get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表", permission = "admin:unimall:pincheMakeAppointment:export",permissionParentName = "宠物管理", permissionName = "预约信息管理")
+	public String export(
+								@HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+							@HttpParam(name = "appointedBy", type = HttpParamType.COMMON, description = "预约人") String appointedBy,
+							@HttpParam(name = "carpoolingType", type = HttpParamType.COMMON, description = "拼车类型") String carpoolingType,
+							@HttpParam(name = "route", type = HttpParamType.COMMON, description = "路线") String route,
+							@HttpParam(name = "phone", type = HttpParamType.COMMON, description = "手机号") String phone,
+							@HttpParam(name = "startPlace", type = HttpParamType.COMMON, description = "出发地点") String startPlace,
+							@HttpParam(name = "endPlace", type = HttpParamType.COMMON, description = "到达地点") String endPlace,
+							@HttpParam(name = "departureLatitude", type = HttpParamType.COMMON, description = "出发经纬度") String departureLatitude,
+							@HttpParam(name = "latitudeArrival", type = HttpParamType.COMMON, description = "到达经纬度") String latitudeArrival,
+							@HttpParam(name = "departureTime", type = HttpParamType.COMMON, description = "出发时间") Date departureTime,
+							@HttpParam(name = "numberPeople", type = HttpParamType.COMMON, description = "人数") String numberPeople,
+							@HttpParam(name = "explain", type = HttpParamType.COMMON, description = "说明") String explain,
+							@HttpParam(name = "unitPrice", type = HttpParamType.COMMON, description = "单价") Double unitPrice,
+							@HttpParam(name = "price", type = HttpParamType.COMMON, description = "总价") Double price,
+							@HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+							@HttpParam(name = "remark1", type = HttpParamType.COMMON, description = "备注1") String remark1,
+							@HttpParam(name = "remark2", type = HttpParamType.COMMON, description = "备注2") String remark2,
+							@HttpParam(name = "remark3", type = HttpParamType.COMMON, description = "备注3") String remark3,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Long deleteFlag,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+							@HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 70 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/pinche/IPincheRoutePriceAppService.java

@@ -0,0 +1,70 @@
+package com.iotechn.unimall.app.api.pinche;
+
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.PincheRoutePrice;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+/**
+ * 路线价格Service接口
+ * 
+ * @author jlb
+ * @date 2022-11-30
+ */
+@HttpOpenApi(group = "pincheRoutePriceApp", description = "路线价格")
+public interface IPincheRoutePriceAppService {
+	@HttpMethod(description = "新增", permission = "admin:unimall:pincheRoutePrice:add", permissionParentName = "宠物管理", permissionName = "路线价格管理")
+	public Boolean add(@NotNull @HttpParam(name = "pincheRoutePrice", type = HttpParamType.COMMON, description = "路线价格") PincheRoutePrice pincheRoutePrice,
+						   @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId)throws ServiceException;
+
+	@HttpMethod(description = "列表")
+	public Page<PincheRoutePrice> list(
+								@HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+							@HttpParam(name = "route", type = HttpParamType.COMMON, description = "路线") String route,
+							@HttpParam(name = "unitPrice", type = HttpParamType.COMMON, description = "单价") Double unitPrice,
+							@HttpParam(name = "remark1", type = HttpParamType.COMMON, description = "备注1") String remark1,
+							@HttpParam(name = "remark2", type = HttpParamType.COMMON, description = "备注2") String remark2,
+							@HttpParam(name = "remark3", type = HttpParamType.COMMON, description = "备注3") String remark3,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Long deleteFlag,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+							@HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除", permission = "admin:unimall:pincheRoutePrice:delete",permissionParentName = "宠物管理", permissionName = "路线价格管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改", permission = "admin:unimall:pincheRoutePrice:update",permissionParentName = "宠物管理", permissionName = "路线价格管理")
+	public Boolean update(@NotNull @HttpParam(name = "pincheRoutePrice", type = HttpParamType.COMMON, description = "路线价格") PincheRoutePrice pincheRoutePrice,
+						  @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId)throws ServiceException;
+
+	@HttpMethod(description = "查询", permission = "admin:unimall:pincheRoutePrice:get",permissionParentName = "宠物管理", permissionName = "路线价格管理")
+	public PincheRoutePrice get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表", permission = "admin:unimall:pincheRoutePrice:export",permissionParentName = "宠物管理", permissionName = "路线价格管理")
+	public String export(
+								@HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+							@HttpParam(name = "route", type = HttpParamType.COMMON, description = "路线") String route,
+							@HttpParam(name = "unitPrice", type = HttpParamType.COMMON, description = "单价") Double unitPrice,
+							@HttpParam(name = "remark1", type = HttpParamType.COMMON, description = "备注1") String remark1,
+							@HttpParam(name = "remark2", type = HttpParamType.COMMON, description = "备注2") String remark2,
+							@HttpParam(name = "remark3", type = HttpParamType.COMMON, description = "备注3") String remark3,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Long deleteFlag,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+							@HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 217 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/pinche/impl/PincheCarSharingAppServiceImpl.java

@@ -0,0 +1,217 @@
+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.IPincheCarSharingAppService;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.PincheCarSharing;
+import com.iotechn.unimall.data.mapper.PincheCarSharingMapper;
+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 2022-11-30
+ */
+@Service
+public class PincheCarSharingAppServiceImpl implements IPincheCarSharingAppService {
+    @Autowired
+    private PincheCarSharingMapper pincheCarSharingMapper;
+
+    @Override
+    public Boolean add(PincheCarSharing pincheCarSharing, Long adminId) throws ServiceException {
+        Date now = new Date();
+        pincheCarSharing.setStatus("进行中");
+        pincheCarSharing.setGmtCreate(now);
+        pincheCarSharing.setGmtUpdate(now);
+        pincheCarSharing.setAdminId(adminId);
+        return pincheCarSharingMapper.insert(pincheCarSharing) > 0;
+    }
+
+    @Override
+    public Page<PincheCarSharing> list(Long companyId, String carpoolingType, String route, String phone, String startPlace, String endPlace, String departureLatitude, String latitudeArrival, Date departureTime, String numberPeople, String explain, Double unitPrice, Double price, 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<PincheCarSharing> wrapper = new EntityWrapper<PincheCarSharing>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(carpoolingType)) {
+            wrapper.eq("carpooling_type", carpoolingType);
+        }
+        if (!StringUtils.isEmpty(route)) {
+            wrapper.eq("route", route);
+        }
+        if (!StringUtils.isEmpty(phone)) {
+            wrapper.eq("phone", phone);
+        }
+        if (!StringUtils.isEmpty(startPlace)) {
+            wrapper.eq("start_place", startPlace);
+        }
+        if (!StringUtils.isEmpty(endPlace)) {
+            wrapper.eq("end_place", endPlace);
+        }
+        if (!StringUtils.isEmpty(departureLatitude)) {
+            wrapper.eq("departure_latitude", departureLatitude);
+        }
+        if (!StringUtils.isEmpty(latitudeArrival)) {
+            wrapper.eq("latitude_arrival", latitudeArrival);
+        }
+        if (!StringUtils.isEmpty(departureTime)) {
+            wrapper.eq("departure_time", departureTime);
+        }
+        if (!StringUtils.isEmpty(numberPeople)) {
+            wrapper.eq("number_people", numberPeople);
+        }
+        if (!StringUtils.isEmpty(explain)) {
+            wrapper.eq("explain", explain);
+        }
+        if (!StringUtils.isEmpty(unitPrice)) {
+            wrapper.eq("unit_price", unitPrice);
+        }
+        if (!StringUtils.isEmpty(price)) {
+            wrapper.eq("price", price);
+        }
+        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);
+        wrapper.orderBy("departure_time",false);
+        List<PincheCarSharing> list = pincheCarSharingMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = pincheCarSharingMapper.selectCount(wrapper);
+        return new Page<PincheCarSharing>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            PincheCarSharing tmp = pincheCarSharingMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1l);
+                pincheCarSharingMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(PincheCarSharing pincheCarSharing, Long adminId) throws ServiceException {
+        Date now = new Date();
+        pincheCarSharing.setGmtUpdate(now);
+        pincheCarSharing.setAdminId(adminId);
+        return pincheCarSharingMapper.updateById(pincheCarSharing) > 0;
+    }
+
+    @Override
+    public PincheCarSharing get(Long id) throws ServiceException {
+        return pincheCarSharingMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long companyId, String carpoolingType, String route, String phone, String startPlace, String endPlace, String departureLatitude, String latitudeArrival, Date departureTime, String numberPeople, String explain, Double unitPrice, Double price, 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<PincheCarSharing> wrapper = new EntityWrapper<PincheCarSharing>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(carpoolingType)) {
+            wrapper.eq("carpooling_type", carpoolingType);
+        }
+        if (!StringUtils.isEmpty(route)) {
+            wrapper.eq("route", route);
+        }
+        if (!StringUtils.isEmpty(phone)) {
+            wrapper.eq("phone", phone);
+        }
+        if (!StringUtils.isEmpty(startPlace)) {
+            wrapper.eq("start_place", startPlace);
+        }
+        if (!StringUtils.isEmpty(endPlace)) {
+            wrapper.eq("end_place", endPlace);
+        }
+        if (!StringUtils.isEmpty(departureLatitude)) {
+            wrapper.eq("departure_latitude", departureLatitude);
+        }
+        if (!StringUtils.isEmpty(latitudeArrival)) {
+            wrapper.eq("latitude_arrival", latitudeArrival);
+        }
+        if (!StringUtils.isEmpty(departureTime)) {
+            wrapper.eq("departure_time", departureTime);
+        }
+        if (!StringUtils.isEmpty(numberPeople)) {
+            wrapper.eq("number_people", numberPeople);
+        }
+        if (!StringUtils.isEmpty(explain)) {
+            wrapper.eq("explain", explain);
+        }
+        if (!StringUtils.isEmpty(unitPrice)) {
+            wrapper.eq("unit_price", unitPrice);
+        }
+        if (!StringUtils.isEmpty(price)) {
+            wrapper.eq("price", price);
+        }
+        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<PincheCarSharing> list = pincheCarSharingMapper.selectList(wrapper);
+        ExcelUtil<PincheCarSharing> util = new ExcelUtil<PincheCarSharing>(PincheCarSharing.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 221 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/pinche/impl/PincheMakeAppointmentAppServiceImpl.java

@@ -0,0 +1,221 @@
+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.IPincheMakeAppointmentAppService;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.PincheMakeAppointment;
+import com.iotechn.unimall.data.mapper.PincheMakeAppointmentMapper;
+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 2022-11-30
+ */
+@Service
+public class PincheMakeAppointmentAppServiceImpl implements IPincheMakeAppointmentAppService {
+    @Autowired
+    private PincheMakeAppointmentMapper pincheMakeAppointmentMapper;
+
+    @Override
+    public Boolean add(PincheMakeAppointment pincheMakeAppointment, Long adminId) throws ServiceException {
+        Date now = new Date();
+        pincheMakeAppointment.setGmtCreate(now);
+        pincheMakeAppointment.setGmtUpdate(now);
+        pincheMakeAppointment.setAdminId(adminId);
+        return pincheMakeAppointmentMapper.insert(pincheMakeAppointment) > 0;
+    }
+
+    @Override
+    public Page<PincheMakeAppointment> list(Long companyId, String appointedBy, String carpoolingType, String route, String phone, String startPlace, String endPlace, String departureLatitude, String latitudeArrival, Date departureTime, String numberPeople, String explain, Double unitPrice, Double price, 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<PincheMakeAppointment> wrapper = new EntityWrapper<PincheMakeAppointment>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(appointedBy)) {
+            wrapper.eq("appointed_by", appointedBy);
+        }
+        if (!StringUtils.isEmpty(carpoolingType)) {
+            wrapper.eq("carpooling_type", carpoolingType);
+        }
+        if (!StringUtils.isEmpty(route)) {
+            wrapper.eq("route", route);
+        }
+        if (!StringUtils.isEmpty(phone)) {
+            wrapper.eq("phone", phone);
+        }
+        if (!StringUtils.isEmpty(startPlace)) {
+            wrapper.eq("start_place", startPlace);
+        }
+        if (!StringUtils.isEmpty(endPlace)) {
+            wrapper.eq("end_place", endPlace);
+        }
+        if (!StringUtils.isEmpty(departureLatitude)) {
+            wrapper.eq("departure_latitude", departureLatitude);
+        }
+        if (!StringUtils.isEmpty(latitudeArrival)) {
+            wrapper.eq("latitude_arrival", latitudeArrival);
+        }
+        if (!StringUtils.isEmpty(departureTime)) {
+            wrapper.eq("departure_time", departureTime);
+        }
+        if (!StringUtils.isEmpty(numberPeople)) {
+            wrapper.eq("number_people", numberPeople);
+        }
+        if (!StringUtils.isEmpty(explain)) {
+            wrapper.eq("explain", explain);
+        }
+        if (!StringUtils.isEmpty(unitPrice)) {
+            wrapper.eq("unit_price", unitPrice);
+        }
+        if (!StringUtils.isEmpty(price)) {
+            wrapper.eq("price", price);
+        }
+        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<PincheMakeAppointment> list = pincheMakeAppointmentMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = pincheMakeAppointmentMapper.selectCount(wrapper);
+        return new Page<PincheMakeAppointment>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            PincheMakeAppointment tmp = pincheMakeAppointmentMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1l);
+                pincheMakeAppointmentMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(PincheMakeAppointment pincheMakeAppointment, Long adminId) throws ServiceException {
+        Date now = new Date();
+        pincheMakeAppointment.setGmtUpdate(now);
+        pincheMakeAppointment.setAdminId(adminId);
+        return pincheMakeAppointmentMapper.updateById(pincheMakeAppointment) > 0;
+    }
+
+    @Override
+    public PincheMakeAppointment get(Long id) throws ServiceException {
+        return pincheMakeAppointmentMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long companyId, String appointedBy, String carpoolingType, String route, String phone, String startPlace, String endPlace, String departureLatitude, String latitudeArrival, Date departureTime, String numberPeople, String explain, Double unitPrice, Double price, 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<PincheMakeAppointment> wrapper = new EntityWrapper<PincheMakeAppointment>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(appointedBy)) {
+            wrapper.eq("appointed_by", appointedBy);
+        }
+        if (!StringUtils.isEmpty(carpoolingType)) {
+            wrapper.eq("carpooling_type", carpoolingType);
+        }
+        if (!StringUtils.isEmpty(route)) {
+            wrapper.eq("route", route);
+        }
+        if (!StringUtils.isEmpty(phone)) {
+            wrapper.eq("phone", phone);
+        }
+        if (!StringUtils.isEmpty(startPlace)) {
+            wrapper.eq("start_place", startPlace);
+        }
+        if (!StringUtils.isEmpty(endPlace)) {
+            wrapper.eq("end_place", endPlace);
+        }
+        if (!StringUtils.isEmpty(departureLatitude)) {
+            wrapper.eq("departure_latitude", departureLatitude);
+        }
+        if (!StringUtils.isEmpty(latitudeArrival)) {
+            wrapper.eq("latitude_arrival", latitudeArrival);
+        }
+        if (!StringUtils.isEmpty(departureTime)) {
+            wrapper.eq("departure_time", departureTime);
+        }
+        if (!StringUtils.isEmpty(numberPeople)) {
+            wrapper.eq("number_people", numberPeople);
+        }
+        if (!StringUtils.isEmpty(explain)) {
+            wrapper.eq("explain", explain);
+        }
+        if (!StringUtils.isEmpty(unitPrice)) {
+            wrapper.eq("unit_price", unitPrice);
+        }
+        if (!StringUtils.isEmpty(price)) {
+            wrapper.eq("price", price);
+        }
+        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<PincheMakeAppointment> list = pincheMakeAppointmentMapper.selectList(wrapper);
+        ExcelUtil<PincheMakeAppointment> util = new ExcelUtil<PincheMakeAppointment>(PincheMakeAppointment.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 149 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/pinche/impl/PincheRoutePriceAppServiceImpl.java

@@ -0,0 +1,149 @@
+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.IPincheRoutePriceAppService;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.PincheRoutePrice;
+import com.iotechn.unimall.data.mapper.PincheRoutePriceMapper;
+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 2022-11-30
+ */
+@Service
+public class PincheRoutePriceAppServiceImpl implements IPincheRoutePriceAppService {
+    @Autowired
+    private PincheRoutePriceMapper pincheRoutePriceMapper;
+
+    @Override
+    public Boolean add(PincheRoutePrice pincheRoutePrice, Long adminId) throws ServiceException {
+        Date now = new Date();
+        pincheRoutePrice.setGmtCreate(now);
+        pincheRoutePrice.setGmtUpdate(now);
+        pincheRoutePrice.setAdminId(adminId);
+        return pincheRoutePriceMapper.insert(pincheRoutePrice) > 0;
+    }
+
+    @Override
+    public Page<PincheRoutePrice> list(Long companyId, String route, Double unitPrice, String remark1, String remark2, String remark3, Long deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
+        Wrapper<PincheRoutePrice> wrapper = new EntityWrapper<PincheRoutePrice>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(route)) {
+            wrapper.eq("route", route);
+        }
+        if (!StringUtils.isEmpty(unitPrice)) {
+            wrapper.eq("unit_price", unitPrice);
+        }
+        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<PincheRoutePrice> list = pincheRoutePriceMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = pincheRoutePriceMapper.selectCount(wrapper);
+        return new Page<PincheRoutePrice>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            PincheRoutePrice tmp = pincheRoutePriceMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1l);
+                pincheRoutePriceMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(PincheRoutePrice pincheRoutePrice, Long adminId) throws ServiceException {
+        Date now = new Date();
+        pincheRoutePrice.setGmtUpdate(now);
+        pincheRoutePrice.setAdminId(adminId);
+        return pincheRoutePriceMapper.updateById(pincheRoutePrice) > 0;
+    }
+
+    @Override
+    public PincheRoutePrice get(Long id) throws ServiceException {
+        return pincheRoutePriceMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long companyId, String route, Double unitPrice, String remark1, String remark2, String remark3, Long deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
+        Wrapper<PincheRoutePrice> wrapper = new EntityWrapper<PincheRoutePrice>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(route)) {
+            wrapper.eq("route", route);
+        }
+        if (!StringUtils.isEmpty(unitPrice)) {
+            wrapper.eq("unit_price", unitPrice);
+        }
+        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<PincheRoutePrice> list = pincheRoutePriceMapper.selectList(wrapper);
+        ExcelUtil<PincheRoutePrice> util = new ExcelUtil<PincheRoutePrice>(PincheRoutePrice.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 4 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/user/UserService.java

@@ -1,5 +1,6 @@
 package com.iotechn.unimall.app.api.user;
 
+import com.alibaba.fastjson.JSONObject;
 import com.iotechn.unimall.core.Const;
 import com.iotechn.unimall.core.annotation.HttpMethod;
 import com.iotechn.unimall.core.annotation.HttpOpenApi;
@@ -8,6 +9,7 @@ import com.iotechn.unimall.core.annotation.HttpParamType;
 import com.iotechn.unimall.core.annotation.param.NotNull;
 import com.iotechn.unimall.core.annotation.param.TextFormat;
 import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.AjaxResult;
 import com.iotechn.unimall.data.dto.UserDTO;
 
 /**
@@ -73,4 +75,6 @@ public interface UserService {
     public Object getH5Sign(
             @NotNull @HttpParam(name = "url", type = HttpParamType.COMMON, description = "url") String url) throws ServiceException;
 
+    public AjaxResult appletLogin(@NotNull @HttpParam(name = "code", type = HttpParamType.COMMON, description = "code")JSONObject code) throws Exception;
+
 }

+ 23 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/user/UserServiceImpl.java

@@ -1,5 +1,6 @@
 package com.iotechn.unimall.app.api.user;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.iotechn.unimall.biz.service.user.UserBizService;
@@ -13,12 +14,15 @@ import com.iotechn.unimall.core.notify.SMSResult;
 import com.iotechn.unimall.core.util.GeneratorUtil;
 import com.iotechn.unimall.core.util.SHA1Util;
 import com.iotechn.unimall.data.component.CacheComponent;
+import com.iotechn.unimall.data.domain.AjaxResult;
 import com.iotechn.unimall.data.domain.UserDO;
 import com.iotechn.unimall.data.dto.UserDTO;
 import com.iotechn.unimall.data.enums.UserLevelType;
 import com.iotechn.unimall.data.enums.UserLoginType;
 import com.iotechn.unimall.data.mapper.UserMapper;
+import com.iotechn.unimall.data.util.HttpRequestUtil;
 import com.iotechn.unimall.data.util.SessionUtil;
+import com.iotechn.unimall.data.util.WeiXinQiYeUtil;
 import okhttp3.OkHttpClient;
 import okhttp3.Request;
 import org.apache.commons.codec.digest.Md5Crypt;
@@ -84,6 +88,25 @@ public class UserServiceImpl implements UserService {
     @Value("${com.iotechn.unimall.wx.h5.app-secret}")
     private String wxH5Secret;
 
+    /**
+     * 企业小程序授权登录
+     * @param code
+     * @return
+     */
+    @Override
+    public AjaxResult appletLogin(JSONObject code) throws Exception {
+
+        String accessToken = WeiXinQiYeUtil.accessToken();
+
+        String appletCode = code.getString("code");
+        String url = "https://qyapi.weixin.qq.com/cgi-bin/miniprogram/jscode2session?access_token="+accessToken+"&js_code="+appletCode+"&grant_type=authorization_code";
+        String msg = HttpRequestUtil.httpGet(url,null);
+//        log.info("msg: "+msg);
+        JSONObject jsonObject = JSON.parseObject(msg);
+        return AjaxResult.success(jsonObject);
+    }
+
+
     @Override
     public String sendVerifyCode(String phone) throws ServiceException {
         String verifyCode = GeneratorUtil.genSixVerifyCode();

+ 8 - 0
unimall-data/pom.xml

@@ -122,6 +122,14 @@
 			<artifactId>spring-boot-starter-test</artifactId>
 			<scope>test</scope>
 		</dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-annotations</artifactId>
+        </dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-annotations</artifactId>
+		</dependency>
 	</dependencies>
 
 </project>

+ 15 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/domain/AccessToken.java

@@ -0,0 +1,15 @@
+package com.iotechn.unimall.data.domain;
+
+import lombok.Data;
+
+/**
+ * 企业微信生成Token凭证
+ */
+@Data
+public class AccessToken {
+
+    private String errCode;
+    private String errMsg;
+    private String accessToken;
+    private String expiresIn;
+}

+ 175 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/domain/CacheComponent.java

@@ -0,0 +1,175 @@
+package com.iotechn.unimall.data.domain;
+
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Created by rize on 2019/3/22.
+ */
+@Component
+public class CacheComponent {
+
+    @Autowired
+    private StringRedisTemplate stringRedisTemplate;
+
+    public void putObj(String key, Object obj, Integer expireSec) {
+        if (expireSec != null) {
+            stringRedisTemplate.opsForValue().set(key, JSONObject.toJSONString(obj), expireSec, TimeUnit.SECONDS);
+        } else {
+            stringRedisTemplate.opsForValue().set(key, JSONObject.toJSONString(obj));
+        }
+    }
+
+    public Long incRaw(String key) {
+        return stringRedisTemplate.opsForValue().increment(key);
+    }
+
+    public  <T> T getObj(String key, Class<T> clazz) {
+        String json = stringRedisTemplate.opsForValue().get(key);
+        if (StringUtils.isEmpty(json)) {
+            return null;
+        }
+        return JSONObject.parseObject(json, clazz);
+    }
+
+    public <T> List<T> getObjList(String key, Class<T> clazz) {
+        String json = stringRedisTemplate.opsForValue().get(key);
+        if (StringUtils.isEmpty(json)) {
+            return null;
+        }
+        return JSONObject.parseArray(json, clazz);
+    }
+
+    public void putHashAll(String key, Map<String, String> map, Integer expireSec) {
+        stringRedisTemplate.opsForHash().putAll(key, map);
+        stringRedisTemplate.expire(key, expireSec, TimeUnit.SECONDS);
+    }
+
+    public Map<String,String> getHashAll(String key) {
+        if (!stringRedisTemplate.hasKey(key)) {
+            return null;
+        }
+        return (Map)stringRedisTemplate.opsForHash().entries(key);
+    }
+
+    public <T> T getHashObj(String hashName, String key, Class<T> clazz) {
+        String o = (String) stringRedisTemplate.opsForHash().get(hashName, key);
+        if (StringUtils.isEmpty(o)) {
+            return null;
+        }
+        return JSONObject.parseObject(o, clazz);
+    }
+
+    public String getHashRaw(String hashName, String key) {
+        String o = (String) stringRedisTemplate.opsForHash().get(hashName, key);
+        if (StringUtils.isEmpty(o)) {
+            return null;
+        }
+        return o;
+    }
+
+    public <T> List<T> getHashArray(String hashName, String key, Class<T> clazz) {
+        String o = (String) stringRedisTemplate.opsForHash().get(hashName, key);
+        if (StringUtils.isEmpty(o)) {
+            return null;
+        }
+        return JSONObject.parseArray(o, clazz);
+    }
+
+    public Long incHashRaw(String hashName, String key, long delta) {
+        return stringRedisTemplate.opsForHash().increment(hashName, key, delta);
+    }
+
+    public void putHashRaw(String hashName, String key, String str, Integer expireSec) {
+        boolean hasKey = stringRedisTemplate.hasKey(key);
+        stringRedisTemplate.opsForHash().put(hashName, key, str);
+        if (!hasKey) {
+            stringRedisTemplate.expire(key, expireSec, TimeUnit.SECONDS);
+        }
+    }
+
+    public void putHashRaw(String hashName, String key, String str) {
+        stringRedisTemplate.opsForHash().put(hashName, key, str);
+    }
+
+    public void putHashObj(String hashName, String key, Object obj, Integer expireSec) {
+        boolean hasKey = stringRedisTemplate.hasKey(key);
+        stringRedisTemplate.opsForHash().put(hashName, key, JSONObject.toJSONString(obj));
+        if (!hasKey) {
+            stringRedisTemplate.expire(key, expireSec, TimeUnit.SECONDS);
+        }
+    }
+
+    public void delHashObj(String hashName, String key) {
+        stringRedisTemplate.opsForHash().delete(hashName, key);
+    }
+
+
+    public void putRaw(String key, String value) {
+        putRaw(key, value, null);
+    }
+
+    public void putRaw(String key, String value, Integer expireSec) {
+        if (expireSec != null) {
+            stringRedisTemplate.opsForValue().set(key, value, expireSec, TimeUnit.SECONDS);
+        } else {
+            stringRedisTemplate.opsForValue().set(key, value);
+        }
+    }
+
+    public String getRaw(String key) {
+        return stringRedisTemplate.opsForValue().get(key);
+    }
+
+    public void del(String key) {
+        stringRedisTemplate.delete(key);
+    }
+
+    public boolean hasKey(String key) {
+        return stringRedisTemplate.hasKey(key);
+    }
+
+    public void putSetRaw(String key, String member, Integer expireSec) {
+        stringRedisTemplate.opsForSet().add(key, member);
+        stringRedisTemplate.expire(key, expireSec, TimeUnit.SECONDS);
+    }
+
+    public void putSetRawAll(String key, String[] set, Integer expireSec) {
+        stringRedisTemplate.opsForSet().add(key, set);
+        stringRedisTemplate.expire(key, expireSec, TimeUnit.SECONDS);
+    }
+
+    public void removeSetRaw(String key, String member) {
+        stringRedisTemplate.opsForSet().remove(key, member);
+    }
+
+    public boolean isSetMember(String key, String member) {
+        return stringRedisTemplate.opsForSet().isMember(key, member);
+    }
+
+    /**
+     * 获取指定前缀的Key
+     * @param prefix
+     * @return
+     */
+    public Set<String> getPrefixKeySet(String prefix) {
+        return stringRedisTemplate.keys(prefix + "*");
+    }
+
+    public void delPrefixKey(String prefix) {
+        Set<String> prefixKeySet = getPrefixKeySet(prefix);
+        for (String key : prefixKeySet) {
+            stringRedisTemplate.delete(key);
+        }
+    }
+
+
+}

+ 6 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/domain/PincheCarSharing.java

@@ -1,5 +1,7 @@
 package com.iotechn.unimall.data.domain;
 
+import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.iotechn.unimall.core.framework.aspectj.lang.annotaion.Excel;
@@ -10,6 +12,8 @@ import lombok.Data;
 import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.enums.FieldFill;
 import com.iotechn.unimall.core.util.StringUtils;
+import org.springframework.format.annotation.DateTimeFormat;
+
 import java.util.Date;
 
 /**
@@ -70,6 +74,8 @@ public class PincheCarSharing extends SuperDO{
     /** 出发时间 */
     @Excel(name = "出发时间", width = 30, dateFormat = "yyyy-MM-dd")
     @TableField("departure_time")
+    @JSONField(format = "yyyy-MM-dd HH:mm")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
     private Date departureTime;
 
     /** 人数 */

+ 286 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/util/HttpRequestUtil.java

@@ -0,0 +1,286 @@
+package com.iotechn.unimall.data.util;
+
+import java.io.IOException;
+
+import java.util.ArrayList;
+
+import java.util.HashMap;
+
+import java.util.Iterator;
+
+import java.util.List;
+
+import java.util.Map;
+
+import java.util.Map.Entry;
+
+import java.util.Set;
+
+
+
+import org.apache.http.Header;
+
+import org.apache.http.HttpEntity;
+
+import org.apache.http.HttpResponse;
+
+import org.apache.http.NameValuePair;
+
+import org.apache.http.client.HttpClient;
+
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+
+import org.apache.http.client.methods.CloseableHttpResponse;
+
+import org.apache.http.client.methods.HttpGet;
+
+import org.apache.http.client.methods.HttpPost;
+
+import org.apache.http.impl.client.CloseableHttpClient;
+
+import org.apache.http.impl.client.HttpClients;
+
+import org.apache.http.message.BasicNameValuePair;
+
+import org.apache.http.util.EntityUtils;
+
+import org.slf4j.Logger;
+
+import org.slf4j.LoggerFactory;
+public class HttpRequestUtil {
+    private static final Logger log = LoggerFactory.getLogger(HttpRequestUtil.class);
+
+
+
+    public static String UTF8 = "UTF-8";
+
+
+
+    public static String httpPost(String url, Map<String, String> params, String encoding) throws Exception {
+
+        log.debug("收到HTTP POST请求");
+
+
+
+        String result = "";
+
+        // 创建默认的httpClient实例.    
+
+        CloseableHttpClient httpclient = HttpClients.createDefault();
+
+        // 创建httppost    
+
+        HttpPost httppost = new HttpPost(url);
+
+
+
+        //参数
+
+        List<NameValuePair> formparams = new ArrayList<NameValuePair>();
+
+        if (params != null) {
+
+            log.debug("发送post参数");
+
+            Set<String> keys = params.keySet();
+
+
+
+            for (String key : keys) {
+
+                log.debug("param:" + key);
+
+                formparams.add(new BasicNameValuePair(key, params.get(key)));
+
+            }
+
+
+
+        }
+
+
+
+        UrlEncodedFormEntity uefEntity;
+
+        try {
+
+            uefEntity = new UrlEncodedFormEntity(formparams, encoding);
+
+            httppost.setEntity(uefEntity);
+
+
+
+            log.debug("executing request " + httppost.getURI());
+
+
+
+            CloseableHttpResponse response = httpclient.execute(httppost);
+
+
+
+            try {
+
+                log.debug("返回HTTP状态:" + response.getStatusLine());
+
+
+
+                Header[] headers = response.getAllHeaders();
+
+
+
+                log.debug("返回HTTP头");
+
+                log.debug("--------------------------------------");
+
+                for (Header header : headers) {
+
+                    log.debug(header.getName() + "-->" + header.getValue());
+
+                }
+
+                log.debug("--------------------------------------");
+
+
+
+                HttpEntity entity = response.getEntity();
+
+                if (entity != null) {
+
+                    result = EntityUtils.toString(entity, encoding);
+
+                    log.debug("--------------------------------------");
+
+                    log.debug("Response content: " + result);
+
+                    log.debug("--------------------------------------");
+
+                }
+
+
+
+            } finally {
+
+                response.close();
+
+            }
+
+        } catch (IOException e) {
+
+            throw e;
+
+        } finally {
+
+            // 关闭连接,释放资源    
+
+            try {
+
+                httpclient.close();
+
+            } catch (IOException e) {
+
+            }
+
+        }
+
+
+
+        return result;
+
+    }
+
+
+
+    public static String httpGet(String url, String encoding) throws Exception {
+
+
+
+        log.debug("收到HTTP GET请求");
+
+
+
+        String result = "";
+
+
+
+        CloseableHttpClient httpclient = HttpClients.createDefault();
+
+        try {
+
+            // 创建httpget.    
+
+            HttpGet httpget = new HttpGet(url);
+
+            log.debug("executing request " + httpget.getURI());
+
+            // 执行get请求.    
+
+            CloseableHttpResponse response = httpclient.execute(httpget);
+
+            try {
+
+
+
+                log.debug("返回HTTP状态:" + response.getStatusLine());
+
+
+
+                Header[] headers = response.getAllHeaders();
+
+
+
+                log.debug("返回HTTP头");
+
+                log.debug("--------------------------------------");
+
+                for (Header header : headers) {
+
+                    log.debug(header.getName() + "-->" + header.getValue());
+
+                }
+
+                log.debug("--------------------------------------"); // 获取响应实体    
+
+                HttpEntity entity = response.getEntity();
+
+                if (entity != null) {
+
+                    result = EntityUtils.toString(entity, encoding);
+
+                    // 打印响应内容    
+
+                    log.debug("Response content: " + result);
+
+                }
+
+                log.debug("------------------------------------");
+
+            } finally {
+
+                response.close();
+
+            }
+
+        } catch (Exception e) {
+
+            throw e;
+
+        } finally {
+
+            // 关闭连接,释放资源    
+
+            try {
+
+                httpclient.close();
+
+            } catch (IOException e) {
+
+            }
+
+        }
+
+        return result;
+
+
+
+    }
+}

+ 46 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/util/WeiXinQiYeUtil.java

@@ -0,0 +1,46 @@
+package com.iotechn.unimall.data.util;
+
+import com.alibaba.fastjson.JSONObject;
+import com.iotechn.unimall.data.domain.AccessToken;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.cache.RedisCache;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+@Component
+@Slf4j
+public class WeiXinQiYeUtil {
+
+    @Autowired
+    private RedisTemplate redisCache;
+
+    /**
+     * 获取accessToken
+     *
+     * @return
+     */
+    public static String accessToken() throws Exception {
+        //缓存access_token
+        if (!redisCache.hasKey("qiyeweixin_access_token")) {
+            //获取企业Id和凭证
+            String corpId = "自己企业微信corpId";
+            String corpSecret = "自己企业微信corpSecret";
+
+            //拼接调用企业微信SDK
+            String qyAccessTokenUrl = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" + corpId + "&corpsecret=" + corpSecret;
+            // 获取企业微信 access_token
+            String s = HttpRequestUtil.httpPost(qyAccessTokenUrl,null,null);
+            s = "[" + s + "]";
+            //把读出来的json文件换换为实体
+            List<AccessToken> tokens = JSONObject.parseArray(s, AccessToken.class);
+            String accessToken = tokens.get(0).getAccessToken();
+            return accessToken;
+        }
+
+      return null;
+    }
+}