Commit 10a9df94 authored by hezhen's avatar hezhen

Merge branch 'dev' of http://113.105.137.151:22280/youjj/cloud-platform into dev

parents 3832574d c21ce4ee
...@@ -7,6 +7,10 @@ target/ ...@@ -7,6 +7,10 @@ target/
.settings/ .settings/
.classpath .classpath
ace-modules/ace-tool/src/main/resources/application-dev.yml ace-modules/ace-tool/src/main/resources/application-dev.yml
**/logs
**/src/test **/src/test
**/logs
xx-order/xx-order-server/logs/**
*.log
logs/**
/src/main/test/**
...@@ -63,7 +63,7 @@ public class RandomUtil ...@@ -63,7 +63,7 @@ public class RandomUtil
public static void main(String[] args) { public static void main(String[] args) {
int max = 20; int max = 20;
int n = 20; int n = 30;
Set<Integer> set = new HashSet<>(); Set<Integer> set = new HashSet<>();
randomSet(max, n, set, n); randomSet(max, n, set, n);
for(Integer a : set) { for(Integer a : set) {
......
...@@ -37,4 +37,6 @@ public class GoodDataVO{ ...@@ -37,4 +37,6 @@ public class GoodDataVO{
@ApiModelProperty(value = "纬度") @ApiModelProperty(value = "纬度")
private Double latitude; private Double latitude;
@ApiModelProperty("seo*html标签优化")
private String alt;
} }
...@@ -9,4 +9,6 @@ public class PageParam { ...@@ -9,4 +9,6 @@ public class PageParam {
Integer page; Integer page;
@ApiModelProperty("每页限制") @ApiModelProperty("每页限制")
Integer limit; Integer limit;
} }
...@@ -25,6 +25,8 @@ public class Menu { ...@@ -25,6 +25,8 @@ public class Menu {
private String type; private String type;
private String state;
private String description; private String description;
@Column(name = "crt_time") @Column(name = "crt_time")
...@@ -167,6 +169,20 @@ public class Menu { ...@@ -167,6 +169,20 @@ public class Menu {
this.type = type; this.type = type;
} }
/**
* @return state
*/
public String getState() {
return state;
}
/**
* @param state
*/
public void setState(String state) {
this.state = state;
}
/** /**
* @return description * @return description
*/ */
......
...@@ -120,8 +120,11 @@ public class UserController extends CommonBaseController { ...@@ -120,8 +120,11 @@ public class UserController extends CommonBaseController {
@RequestMapping(value = "/front/menus", method = RequestMethod.GET) @RequestMapping(value = "/front/menus", method = RequestMethod.GET)
public @ResponseBody public @ResponseBody
List<MenuTree> getMenusByUsername(String token) throws Exception { List<MenuTree> getMenusByUsername(String token,String state) throws Exception {
return permissionService.getMenusByUsername(token); if (StringUtils.isBlank(state)){
state="0,1";
}
return permissionService.getMenusByUsername(token,state);
} }
@RequestMapping(value = "/front/menu/all", method = RequestMethod.GET) @RequestMapping(value = "/front/menu/all", method = RequestMethod.GET)
......
...@@ -170,13 +170,14 @@ public class PermissionService { ...@@ -170,13 +170,14 @@ public class PermissionService {
return frontUser; return frontUser;
} }
public List<MenuTree> getMenusByUsername(String token) throws Exception { public List<MenuTree> getMenusByUsername(String token,String state) throws Exception {
String username = userAuthUtil.getInfoFromToken(token).getUniqueName(); String username = userAuthUtil.getInfoFromToken(token).getUniqueName();
if (username == null) { if (username == null) {
return null; return null;
} }
User user = userBiz.getUserByUsername(username); User user = userBiz.getUserByUsername(username);
List<Menu> menus = menuBiz.getUserAuthorityMenuByUserId(user.getId()); List<Menu> menus = menuBiz.getUserAuthorityMenuByUserId(user.getId());
menus=menus.stream().filter(a->state.contains(a.getState()==null?"1":a.getState())).collect(Collectors.toList());
return getMenuTree(menus,AdminCommonConstant.ROOT); return getMenuTree(menus,AdminCommonConstant.ROOT);
} }
} }
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<result column="href" jdbcType="VARCHAR" property="href"/> <result column="href" jdbcType="VARCHAR" property="href"/>
<result column="icon" jdbcType="VARCHAR" property="icon"/> <result column="icon" jdbcType="VARCHAR" property="icon"/>
<result column="type" jdbcType="CHAR" property="type"/> <result column="type" jdbcType="CHAR" property="type"/>
<result column="state" jdbcType="INTEGER" property="state"/>
<result column="description" jdbcType="VARCHAR" property="description"/> <result column="description" jdbcType="VARCHAR" property="description"/>
<result column="crt_time" jdbcType="DATE" property="crtTime"/> <result column="crt_time" jdbcType="DATE" property="crtTime"/>
<result column="crt_user" jdbcType="VARCHAR" property="crtUser"/> <result column="crt_user" jdbcType="VARCHAR" property="crtUser"/>
......
...@@ -24,6 +24,8 @@ import java.util.List; ...@@ -24,6 +24,8 @@ import java.util.List;
@FeignClient(value = "xx-activity") @FeignClient(value = "xx-activity")
public interface ActivityFeign { public interface ActivityFeign {
public static final Integer TYPE_CHECK = 2;
public static final Integer TYPE_USE = 1; public static final Integer TYPE_USE = 1;
public static final Integer TYPE_NO_USE = 0; public static final Integer TYPE_NO_USE = 0;
......
...@@ -16,6 +16,7 @@ import com.xxfc.platform.activity.dto.UserCouponSendDTO; ...@@ -16,6 +16,7 @@ import com.xxfc.platform.activity.dto.UserCouponSendDTO;
import com.xxfc.platform.activity.entity.Coupon; import com.xxfc.platform.activity.entity.Coupon;
import com.xxfc.platform.activity.entity.IntegralUserTotal; import com.xxfc.platform.activity.entity.IntegralUserTotal;
import com.xxfc.platform.activity.entity.UserCoupon; import com.xxfc.platform.activity.entity.UserCoupon;
import com.xxfc.platform.activity.feign.ActivityFeign;
import com.xxfc.platform.activity.vo.CouponVo; import com.xxfc.platform.activity.vo.CouponVo;
import com.xxfc.platform.activity.vo.UserCouponPageVo; import com.xxfc.platform.activity.vo.UserCouponPageVo;
import com.xxfc.platform.activity.vo.UserCouponVo; import com.xxfc.platform.activity.vo.UserCouponVo;
...@@ -289,7 +290,7 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> { ...@@ -289,7 +290,7 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
return mapper.getUserCoupon(tickerNo); return mapper.getUserCoupon(tickerNo);
} }
//支付后更新优惠卷状态:type.1- //支付后更新优惠卷状态:type.1-触发使用优惠券;0-不触发优惠券使用(在优惠券未使用时);2--不触发优惠券使用(不管优惠券是否已使用)
public BigDecimal useTickerNo(Integer userId, List<String> tickerNos, String orderNo,Integer channel,BigDecimal amout,Integer type){ public BigDecimal useTickerNo(Integer userId, List<String> tickerNos, String orderNo,Integer channel,BigDecimal amout,Integer type){
BigDecimal couponAmout=new BigDecimal("0.00"); BigDecimal couponAmout=new BigDecimal("0.00");
if(couponAmout.compareTo(amout) >= 0) { if(couponAmout.compareTo(amout) >= 0) {
...@@ -307,7 +308,8 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> { ...@@ -307,7 +308,8 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
return couponAmout; return couponAmout;
} }
for (UserCoupon userCoupon:list) { for (UserCoupon userCoupon:list) {
if(userCoupon!=null&&userCoupon.getIsUse()==1){ //zjw_0907 当type 为 check(即2)不判断 优惠券是否已使用
if(userCoupon!=null && userCoupon.getIsUse()==1 && !ActivityFeign.TYPE_CHECK.equals(type)){
log.error(userId+"----该优惠卷已使用--tickerNo=="); log.error(userId+"----该优惠卷已使用--tickerNo==");
continue; continue;
} }
......
...@@ -110,4 +110,9 @@ public class Banner { ...@@ -110,4 +110,9 @@ public class Banner {
* 平台 0:APP 1:欣欣房车官网 2:滴房车官网 * 平台 0:APP 1:欣欣房车官网 2:滴房车官网
*/ */
private Integer platform; private Integer platform;
/**
* html 标签悬浮显示 seo 需要
*/
private String alt;
} }
...@@ -23,4 +23,9 @@ public class BannerVo { ...@@ -23,4 +23,9 @@ public class BannerVo {
* 跳转链接地址 * 跳转链接地址
*/ */
private String url; private String url;
/**
* seo html标签优化
*/
private String alt;
} }
...@@ -30,6 +30,7 @@ public class BannerBiz extends BaseBiz<BannerMapper,Banner> { ...@@ -30,6 +30,7 @@ public class BannerBiz extends BaseBiz<BannerMapper,Banner> {
bannerVo.setUrl(banner.getUrl()); bannerVo.setUrl(banner.getUrl());
bannerVo.setTitle(banner.getTitle()); bannerVo.setTitle(banner.getTitle());
bannerVo.setId(banner.getId()); bannerVo.setId(banner.getId());
bannerVo.setAlt(banner.getAlt());
bannerVos.add(bannerVo); bannerVos.add(bannerVo);
}); });
return bannerVos; return bannerVos;
......
...@@ -165,4 +165,7 @@ public class CampsiteShopAdminDTO { ...@@ -165,4 +165,7 @@ public class CampsiteShopAdminDTO {
@ApiModelProperty(value = "海报背景") @ApiModelProperty(value = "海报背景")
private String posterBackground; private String posterBackground;
@ApiModelProperty("seo*html标签优化")
private String alt;
} }
...@@ -76,4 +76,8 @@ public class CampsiteShopDetailDTO { ...@@ -76,4 +76,8 @@ public class CampsiteShopDetailDTO {
@ApiModelProperty(value = "海报背景") @ApiModelProperty(value = "海报背景")
private String posterBackground; private String posterBackground;
@ApiModelProperty("seo*html标签优化")
private String alt;
} }
...@@ -213,4 +213,7 @@ public class CampsiteShop implements Serializable { ...@@ -213,4 +213,7 @@ public class CampsiteShop implements Serializable {
@Column(name = "poster_background") @Column(name = "poster_background")
@ApiModelProperty(value = "海报背景") @ApiModelProperty(value = "海报背景")
private String posterBackground; private String posterBackground;
@ApiModelProperty("seo*html标签优化")
private String alt;
} }
...@@ -172,4 +172,7 @@ public class CampsiteShopAdminVO { ...@@ -172,4 +172,7 @@ public class CampsiteShopAdminVO {
@ApiModelProperty(value = "海报背景") @ApiModelProperty(value = "海报背景")
private String posterBackground; private String posterBackground;
@ApiModelProperty("seo*html标签优化")
private String alt;
} }
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
<result property="isDel" column="is_del"/> <result property="isDel" column="is_del"/>
<result property="hot" column="hot"/> <result property="hot" column="hot"/>
<result property="saleState" column="sale_state"/> <result property="saleState" column="sale_state"/>
<result property="alt" column="alt"/>
</resultMap> </resultMap>
<!--根据类型查询全部--> <!--根据类型查询全部-->
...@@ -73,7 +74,7 @@ ...@@ -73,7 +74,7 @@
<!--首页查询全部--> <!--首页查询全部-->
<select id="findAllByHome" resultType="com.github.wxiaoqi.security.common.vo.GoodDataVO"> <select id="findAllByHome" resultType="com.github.wxiaoqi.security.common.vo.GoodDataVO">
select cs.id as `id`,cs.name as `name`,cs.logo as `imgUrl`,cs.province_name as `name1`,cs.longitude,cs.latitude select cs.id as `id`,cs.name as `name`,cs.logo as `imgUrl`,cs.province_name as `name1`,cs.longitude,cs.latitude,cs.alt
FROM `campsite_shop` cs FROM `campsite_shop` cs
where cs.sale_state=1 and cs.is_del=0 where cs.sale_state=1 and cs.is_del=0
order by cs.hot desc order by cs.hot desc
...@@ -81,7 +82,7 @@ ...@@ -81,7 +82,7 @@
</select> </select>
<select id="findAll" resultType="com.github.wxiaoqi.security.common.vo.GoodDataVO"> <select id="findAll" resultType="com.github.wxiaoqi.security.common.vo.GoodDataVO">
select cs.id as `id`,cs.name as `name`,cs.logo as `imgUrl`,cs.province_name as `name1`,cs.longitude,cs.latitude select cs.id as `id`,cs.name as `name`,cs.logo as `imgUrl`,cs.province_name as `name1`,cs.longitude,cs.latitude,cs.alt
FROM `campsite_shop` cs FROM `campsite_shop` cs
where cs.sale_state=1 and cs.is_del=0 where cs.sale_state=1 and cs.is_del=0
order by cs.hot desc order by cs.hot desc
...@@ -90,7 +91,7 @@ ...@@ -90,7 +91,7 @@
<!--根据id查询详情--> <!--根据id查询详情-->
<select id="findCampsiteShopDetailById" resultType="com.xxfc.platform.campsite.dto.CampsiteShopDetailDTO"> <select id="findCampsiteShopDetailById" resultType="com.xxfc.platform.campsite.dto.CampsiteShopDetailDTO">
select `name` as `name`,`province_name` as `provinceName`,`city_name` as `cityName`,`address` as `address`,`service_phone` as `phone`,`logo` as `logo`,`poster_background` as `posterBackground` , select `name` as `name`,`province_name` as `provinceName`,`city_name` as `cityName`,`address` as `address`,`service_phone` as `phone`,`logo` as `logo`,`poster_background` as `posterBackground` ,
`content` as `content`,`configure` as `configure`,`longitude` as `longitude`,`latitude` as `latitude` from `campsite_shop` where `id`=#{id} `content` as `content`,`configure` as `configure`,`longitude` as `longitude`,`latitude` as `latitude`,`alt` from `campsite_shop` where `id`=#{id}
</select> </select>
<!--根据查询条件分页查询--> <!--根据查询条件分页查询-->
......
...@@ -18,7 +18,7 @@ import lombok.NoArgsConstructor; ...@@ -18,7 +18,7 @@ import lombok.NoArgsConstructor;
public class CustomerServiceDTO { public class CustomerServiceDTO {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String id; private Long id;
/** /**
* 客服名称 * 客服名称
......
package com.xxfc.platform.im.model; package com.xxfc.platform.im.entity;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.mongodb.morphia.annotations.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field; import org.springframework.data.mongodb.core.mapping.Field;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Table;
/** /**
* @author libin * @author libin
* @version 1.0 * @version 1.0
...@@ -18,11 +23,15 @@ import org.springframework.data.mongodb.core.mapping.Field; ...@@ -18,11 +23,15 @@ import org.springframework.data.mongodb.core.mapping.Field;
@Builder(toBuilder = true) @Builder(toBuilder = true)
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Entity
@Table(name = "customer_service")
@Document(collection = "customer_service") @Document(collection = "customer_service")
public class CustomerService { public class CustomerService {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
private String id; @javax.persistence.Id
@GeneratedValue(generator = "JDBC")
private Long id;
/** /**
* 客服名称 * 客服名称
*/ */
...@@ -35,21 +44,25 @@ public class CustomerService { ...@@ -35,21 +44,25 @@ public class CustomerService {
* App id * App id
*/ */
@Field("app_user_id") @Field("app_user_id")
@Column(name = "app_user_id")
private Integer appUserId; private Integer appUserId;
/** /**
* im id * im id
*/ */
@Field("im_user_id") @Field("im_user_id")
@Column(name = "im_user_id")
private Integer imUserId; private Integer imUserId;
/** /**
* 区域id * 区域id
*/ */
@Field("area_id") @Field("area_id")
@Column(name = "area_id")
private Integer areaId; private Integer areaId;
/** /**
* 区域名称 * 区域名称
*/ */
@Field("area_name") @Field("area_name")
@Column(name = "area_name")
private String areaName; private String areaName;
/** /**
* 问候语句 * 问候语句
...@@ -63,16 +76,23 @@ public class CustomerService { ...@@ -63,16 +76,23 @@ public class CustomerService {
* 客服电话 * 客服电话
*/ */
private String telphone; private String telphone;
/**
* 登录密码
*/
private String password;
/** /**
* 是事删除 true:删除状态 1:正常 * 是事删除 true:删除状态 1:正常
*/ */
@Field("is_del") @Field("is_del")
@Column(name = "is_del")
private Boolean isDel; private Boolean isDel;
@Field("create_time") @Field("create_time")
@Column(name = "create_time")
private Long createTime; private Long createTime;
@Field("update_time") @Field("update_time")
@Column(name = "update_time")
private Long updateTime; private Long updateTime;
} }
...@@ -20,7 +20,7 @@ import java.io.Serializable; ...@@ -20,7 +20,7 @@ import java.io.Serializable;
public class CustomerServiceVO implements Serializable { public class CustomerServiceVO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String id; private Long id;
/** /**
* 客服名称 * 客服名称
......
package com.xxfc.platform.im.biz;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.BaseResponse;
import com.xxfc.platform.im.dto.CustomerServiceDTO;
import com.xxfc.platform.im.entity.CustomerService;
import com.xxfc.platform.im.model.User;
import com.xxfc.platform.im.repos.CustomerServiceRepository;
import com.xxfc.platform.im.vo.CustomerServiceVO;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.ExampleMatcher;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Service;
import java.time.Instant;
import java.util.*;
import java.util.stream.Collectors;
import static org.springframework.data.mongodb.core.query.Query.query;
import static org.springframework.data.mongodb.core.query.Update.update;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/5 9:49
*/
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CustomerServiceMGBiz {
private final static String INIT_PASSWORD="12345678";
private final static String NICK_PRE_NAME="XXKF";
private final CustomerServiceRepository customerServiceRepository;
private final MongoTemplate mongoTemplate;
private final UserBiz userBiz;
public CustomerServiceVO findById(String id){
CustomerServiceVO customerServiceVO = new CustomerServiceVO();
customerServiceRepository.findById(id).ifPresent(customerService -> {
BeanUtils.copyProperties(customerService,customerServiceVO);
});
Map<Integer, User> imMap = userBiz.findAllByImUserIds(Arrays.asList(customerServiceVO.getImUserId()));
User user = imMap.get(customerServiceVO.getImUserId());
customerServiceVO.setPassword(user.getPassword());
return customerServiceVO;
}
/**
* 添加客服
* @param customerServiceDTO
*/
public void addCustomerService(CustomerServiceDTO customerServiceDTO){
CustomerService customerService = new CustomerService();
BeanUtils.copyProperties(customerServiceDTO,customerService);
customerService.setCreateTime(Instant.now().toEpochMilli());
customerService.setName(String.format("%s%s",NICK_PRE_NAME,customerServiceDTO.getTelphone()));
customerService.setIsDel(false);
Map<String,Object> imMap = new HashMap<>(2);
imMap.put("telephone",customerServiceDTO.getTelphone());
imMap.put("password",INIT_PASSWORD);
imMap.put("nickname",customerService.getName());
BaseResponse imResponse = userBiz.register(imMap);
String imResult = imResponse.getMessage();
JSONObject jsonObject = JSON.parseObject(imResult);
Map<String,Object> data = (Map<String, Object>) jsonObject.get("data");
Object userId = data.get("userId");
if (Objects.isNull(userId)){
throw new BaseException("注册失败");
}
customerService.setImUserId((Integer)userId);
customerServiceRepository.save(customerService);
}
/**
* 1: mongoTemplate.find(Query.query(Criteria.where("isDel").is(false)), CustomerService.class);
*
* 2. customerServiceRepository.findByIsDelEquals(false);
* @return
*/
public List<CustomerServiceVO> findAll() {
List<CustomerServiceVO> customerServiceVOS = new ArrayList<>();
CustomerService customer_service = new CustomerService();
Example<CustomerService> customerServiceExample = Example.of(customer_service, ExampleMatcher.matchingAll());
List<CustomerService> customerServices = customerServiceRepository.findAll(customerServiceExample);
CustomerServiceVO customerServiceVO;
if (CollectionUtils.isNotEmpty(customerServices)){
List<Integer> imUserIds = customerServices.stream().map(CustomerService::getImUserId).collect(Collectors.toList());
Map<Integer, User> imMap = userBiz.findAllByImUserIds(imUserIds);
for (CustomerService customerService : customerServices) {
customerServiceVO = new CustomerServiceVO();
BeanUtils.copyProperties(customerService,customerServiceVO);
User user = imMap.get(customerService.getImUserId());
if (Objects.nonNull(user)){
customerServiceVO.setPassword(user.getPassword());
}
customerServiceVOS.add(customerServiceVO);
}
}
return customerServiceVOS;
}
/**
* 删除客服
* @param id
* @param imUserId
*/
public void updateCustomerServiceIsDelToTrue(String id,Integer imUserId){
Query query = query(Criteria.where("_id").is(id));
Update update = update("is_del", true).set("update_time",Instant.now().toEpochMilli());
mongoTemplate.updateFirst(query, update, Map.class, "customer_service");
userBiz.deleteById(imUserId);
}
}
package com.xxfc.platform.im.mapper;
import com.xxfc.platform.im.entity.CustomerService;
import tk.mybatis.mapper.common.Mapper;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/9 9:55
*/
public interface CustomerServiceMapper extends Mapper<CustomerService> {
}
package com.xxfc.platform.im.repos; package com.xxfc.platform.im.repos;
import com.xxfc.platform.im.model.CustomerService; import com.xxfc.platform.im.entity.CustomerService;
import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query; import org.springframework.data.mongodb.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
......
...@@ -2,6 +2,7 @@ package com.xxfc.platform.im.rest; ...@@ -2,6 +2,7 @@ package com.xxfc.platform.im.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.im.biz.CustomerServiceBiz; import com.xxfc.platform.im.biz.CustomerServiceBiz;
import com.xxfc.platform.im.biz.CustomerServiceMGBiz;
import com.xxfc.platform.im.vo.CustomerServiceVO; import com.xxfc.platform.im.vo.CustomerServiceVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -22,16 +23,19 @@ import java.util.List; ...@@ -22,16 +23,19 @@ import java.util.List;
@RequiredArgsConstructor(onConstructor = @__(@Autowired)) @RequiredArgsConstructor(onConstructor = @__(@Autowired))
@RequestMapping("/app/unauth/customer_service") @RequestMapping("/app/unauth/customer_service")
public class CustomerServiceController { public class CustomerServiceController {
private final CustomerServiceMGBiz customerServiceMGBiz;
private final CustomerServiceBiz customerServiceBiz; private final CustomerServiceBiz customerServiceBiz;
@GetMapping("/list") @GetMapping("/list")
public ObjectRestResponse<List<CustomerServiceVO>> findAll(){ public ObjectRestResponse<List<CustomerServiceVO>> findAll(){
// List<CustomerServiceVO> customerServiceVOS = customerServiceMGBiz.findAll();
List<CustomerServiceVO> customerServiceVOS = customerServiceBiz.findAll(); List<CustomerServiceVO> customerServiceVOS = customerServiceBiz.findAll();
return ObjectRestResponse.succ(customerServiceVOS); return ObjectRestResponse.succ(customerServiceVOS);
} }
@GetMapping("/{id}") @GetMapping("/{id}")
public ObjectRestResponse<CustomerServiceVO> findById(@PathVariable(value = "id") String id){ public ObjectRestResponse<CustomerServiceVO> findById(@PathVariable(value = "id") Long id){
// CustomerServiceVO customerServiceVO = customerServiceMGBiz.findById(id);
CustomerServiceVO customerServiceVO = customerServiceBiz.findById(id); CustomerServiceVO customerServiceVO = customerServiceBiz.findById(id);
return ObjectRestResponse.succ(customerServiceVO); return ObjectRestResponse.succ(customerServiceVO);
} }
......
package com.xxfc.platform.im.rest.admin; package com.xxfc.platform.im.rest.admin;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.im.biz.CustomerServiceBiz; import com.xxfc.platform.im.biz.CustomerServiceBiz;
import com.xxfc.platform.im.biz.CustomerServiceMGBiz;
import com.xxfc.platform.im.biz.UserBiz; import com.xxfc.platform.im.biz.UserBiz;
import com.xxfc.platform.im.dto.CustomerServiceDTO; import com.xxfc.platform.im.dto.CustomerServiceDTO;
import com.xxfc.platform.im.vo.CustomerServiceVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -19,13 +22,28 @@ import org.springframework.web.bind.annotation.*; ...@@ -19,13 +22,28 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping("/admin/customer_service") @RequestMapping("/admin/customer_service")
public class CustomerServiceAdminController { public class CustomerServiceAdminController {
private final CustomerServiceMGBiz customerServiceMGBiz;
private final CustomerServiceBiz customerServiceBiz; private final CustomerServiceBiz customerServiceBiz;
private final UserBiz userBiz; private final UserBiz userBiz;
@GetMapping("/page")
public ObjectRestResponse<PageDataVO<CustomerServiceVO>> findCustomerServiceWithPage(@RequestParam(value = "page") Integer page,
@RequestParam(value = "limit") Integer limit) {
PageDataVO<CustomerServiceVO> pageDataVO = customerServiceBiz.findCustomerServiceWithPage(page,limit);
return ObjectRestResponse.succ(pageDataVO);
}
@GetMapping("/{id}")
public ObjectRestResponse<CustomerServiceDTO> findCustomerService(@PathVariable(value = "id") Long id){
CustomerServiceDTO customerServiceDTO = customerServiceBiz.findCustomerServiceById(id);
return ObjectRestResponse.succ(customerServiceDTO);
}
@PostMapping("/add") @PostMapping("/add")
public ObjectRestResponse<Void> addCustomerService(@RequestBody CustomerServiceDTO customerServiceDTO){ public ObjectRestResponse<Void> addCustomerService(@RequestBody CustomerServiceDTO customerServiceDTO){
// customerServiceMGBiz.addCustomerService(customerServiceDTO);
customerServiceBiz.addCustomerService(customerServiceDTO); customerServiceBiz.addCustomerService(customerServiceDTO);
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
...@@ -34,12 +52,14 @@ public class CustomerServiceAdminController { ...@@ -34,12 +52,14 @@ public class CustomerServiceAdminController {
public ObjectRestResponse<Void> updateCustomerService(@PathVariable(value = "telphone") String telphone, public ObjectRestResponse<Void> updateCustomerService(@PathVariable(value = "telphone") String telphone,
@PathVariable(value = "password") String password){ @PathVariable(value = "password") String password){
userBiz.updatePasswordByPhone(telphone,password); userBiz.updatePasswordByPhone(telphone,password);
customerServiceBiz.updatePasswordByPhone(telphone,password);
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
@DeleteMapping("/delete/{id}/{imUserId}") @DeleteMapping("/delete/{id}/{imUserId}")
public ObjectRestResponse<Void> deleteCustomerService(@PathVariable(value = "id") String id, public ObjectRestResponse<Void> deleteCustomerService(@PathVariable(value = "id") Long id,
@PathVariable(value = "imUserId") Integer imUserId){ @PathVariable(value = "imUserId") Integer imUserId){
// customerServiceMGBiz.updateCustomerServiceIsDelToTrue(id,imUserId);
customerServiceBiz.updateCustomerServiceIsDelToTrue(id,imUserId); customerServiceBiz.updateCustomerServiceIsDelToTrue(id,imUserId);
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
......
package com.xxfc.platform.order.contant.enumerate;
import java.util.HashMap;
import java.util.Map;
public enum OrderViolateEnum {
BEFORE(1, "提前"),
AFTER(2, "延期")
;
/**
* 编码
*/
private Integer code;
/**
* 类型描述
*/
private String desc;
public static Map<Integer, OrderTypeEnum> codeAndDesc = new HashMap<Integer, OrderTypeEnum>();
//Maps.newHashMap();
static{
for(OrderTypeEnum enumE : OrderTypeEnum.values()){
codeAndDesc.put(enumE.getCode(), enumE);
}
}
OrderViolateEnum(Integer code, String desc){
this.code=code;
this.desc=desc;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public static Boolean exists(Integer code){
return codeAndDesc.containsKey(code);
}
public static OrderTypeEnum get(Integer code) {
for(OrderTypeEnum enumE : OrderTypeEnum.values()) {
if (enumE.getCode().equals(code)) {
return enumE;
}
}
return null;
}
}
...@@ -3,9 +3,11 @@ package com.xxfc.platform.order.entity; ...@@ -3,9 +3,11 @@ package com.xxfc.platform.order.entity;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
import javax.persistence.*; import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.assertj.core.util.Lists;
import tk.mybatis.mapper.annotation.Version; import tk.mybatis.mapper.annotation.Version;
...@@ -249,4 +251,32 @@ public class BaseOrder implements Serializable { ...@@ -249,4 +251,32 @@ public class BaseOrder implements Serializable {
@ApiModelProperty(value = "下单时的会员等级") @ApiModelProperty(value = "下单时的会员等级")
@Column(name = "member_level") @Column(name = "member_level")
private Integer memberLevel; private Integer memberLevel;
/**
* 违约金
*/
@ApiModelProperty(value = "违约金")
@Column(name = "violate_amount")
BigDecimal ViolateAmount;
/**
* 赔偿金
*/
@ApiModelProperty(value = "赔偿金")
@Column(name = "damages_amount")
BigDecimal damagesAmount;
/**
* 额外费用
*/
@ApiModelProperty(value = "额外费用")
@Column(name = "extra_amount")
BigDecimal extraAmount;
/**
* 返还的优惠券
*/
@ApiModelProperty(value = "返回的优惠券")
@Column(name = "back_coupon")
String backCoupon;
} }
...@@ -308,4 +308,11 @@ public class OrderRentVehicleDetail implements Serializable { ...@@ -308,4 +308,11 @@ public class OrderRentVehicleDetail implements Serializable {
@Column(name = "fixed_loss_status") @Column(name = "fixed_loss_status")
private Integer fixedLossStatus; private Integer fixedLossStatus;
/**
* 返还的免费天数
*/
@ApiModelProperty(value = "返回的免费天数")
@Column(name = "back_free_days")
Integer backFreeDays;
} }
...@@ -105,6 +105,13 @@ public class OrderVehicleCrosstown { ...@@ -105,6 +105,13 @@ public class OrderVehicleCrosstown {
*/ */
private String dedDetail; private String dedDetail;
/**
* 租车违约金明细
*/
@Column(name = "violate_amount_detail")
private String violateDetail;
/** /**
* 1、交车, 2、还车, 3、定损还车 * 1、交车, 2、还车, 3、定损还车
*/ */
......
package com.xxfc.platform.order.pojo.calculate;
import lombok.Data;
import org.assertj.core.util.Lists;
import java.math.BigDecimal;
import java.util.List;
@Data
public class InProgressVO {
/**
* 违约金
*/
BigDecimal ViolateAmount = BigDecimal.ZERO;
/**
* 赔偿金
*/
BigDecimal damagesAmount = BigDecimal.ZERO;
/**
* 额外费用
*/
BigDecimal extraAmount = BigDecimal.ZERO;
/**
* 返还的优惠券
*/
List<String> backCoupons = Lists.newArrayList();
/**
* 返还的免费天数
*/
Integer backFreeDays = 0;
}
package com.xxfc.platform.order.biz.inner;
import cn.hutool.core.date.DateUtil;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.activity.entity.Coupon;
import com.xxfc.platform.activity.feign.ActivityFeign;
import com.xxfc.platform.app.entity.Cofig;
import com.xxfc.platform.app.feign.ConfigFeign;
import com.xxfc.platform.order.biz.OrderItemBiz;
import com.xxfc.platform.order.biz.OrderRefundBiz;
import com.xxfc.platform.order.contant.enumerate.ItemTypeEnum;
import com.xxfc.platform.order.contant.enumerate.OrderTypeEnum;
import com.xxfc.platform.order.contant.enumerate.RefundStatusEnum;
import com.xxfc.platform.order.contant.enumerate.RefundTypeEnum;
import com.xxfc.platform.order.entity.*;
import com.xxfc.platform.order.pojo.calculate.InProgressVO;
import com.xxfc.platform.universal.constant.DictionaryKey;
import com.xxfc.platform.universal.dto.SmsTemplateDTO;
import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.feign.ThirdFeign;
import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.CompanyDetail;
import lombok.extern.slf4j.Slf4j;
import org.assertj.core.util.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.HOUR_MINUTE_FORMATTE_HUTOOL;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
/**
* 订单退款记录表
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-18 11:08:09
*/
@Slf4j
@Service
public class OrderCalculateBiz {
@Autowired
UserFeign userFeign;
@Autowired
ThirdFeign thirdFeign;
@Autowired
VehicleFeign vehicleFeign;
@Autowired
ConfigFeign configFeign;
@Autowired
ActivityFeign activityFeign;
@Autowired
OrderRefundBiz orderRefundBiz;
@Autowired
OrderItemBiz orderItemBiz;
public InProgressVO inProgressCalculate(BaseOrder baseOrder, OrderItem orderItem, Integer freeDays, Integer useDays) {
//计算:剩余免费天数
Integer backFreeDays = freeDays - useDays;
//过了出发时间取消订单 ,优先使用免费天数
if(backFreeDays <= 0) {
//大于总天数 只返回押金
if(useDays >= orderItem.getTotalNum()) {
//退押金
//orderRefundBiz.rentRefundDepositProcess(hasUpdateOrder, orvd.getDeposit(), timeLag, APP_ORDER+ "_"+ RENT_REFUND, freeDayAmount);
}else {
//需要扣除订单费用
//判断是否达到优惠券条件 不符合则返还优惠券
Integer consumeDays = 0 - backFreeDays;
//计算使用天数的费用
BigDecimal consumeAmount = orderItem.getUnitPrice().multiply(new BigDecimal(consumeDays+""));
List<String> backCouponNos = Lists.newArrayList();
List<BigDecimal> couponAmounts = Lists.newArrayList();
for(String tickerNo : baseOrder.getCouponTickerNos().split(",")) {
BigDecimal couponAmount = activityFeign.use(baseOrder.getUserId(), Lists.newArrayList(tickerNo), baseOrder.getNo(), Coupon.CHANNEL_RENT, consumeAmount, ActivityFeign.TYPE_CHECK);
if(couponAmount.compareTo(BigDecimal.ZERO) > 0) {
//能够使用优惠券,则不返还
couponAmounts.add(couponAmount);
} else {
backCouponNos.add(tickerNo);
}
}
}
}else {
//返回剩余免费天数,返回优惠券,订单款
}
return new InProgressVO();
}
public InProgressVO inProgressCalculate(BaseOrder baseOrder, Integer useDays) {
OrderItem orderItem = orderItemBiz.selectOne(new OrderItem(){{
setType(ItemTypeEnum.VEHICLE_MODEL.getCode());
setOrderId(baseOrder.getId());
}});
Integer freeDays = (null == orderItem.getCutNum())?0 :orderItem.getCutNum();
return inProgressCalculate(baseOrder, orderItem, freeDays, useDays);
}
}
\ No newline at end of file
...@@ -4,15 +4,19 @@ import com.github.wxiaoqi.security.admin.feign.UserFeign; ...@@ -4,15 +4,19 @@ import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO; import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.activity.entity.Coupon;
import com.xxfc.platform.activity.feign.ActivityFeign;
import com.xxfc.platform.order.biz.*; import com.xxfc.platform.order.biz.*;
import com.xxfc.platform.order.contant.enumerate.*; import com.xxfc.platform.order.contant.enumerate.*;
import com.xxfc.platform.order.entity.*; import com.xxfc.platform.order.entity.*;
import com.xxfc.platform.order.pojo.calculate.InProgressVO;
import com.xxfc.platform.order.pojo.mq.OrderMQDTO; import com.xxfc.platform.order.pojo.mq.OrderMQDTO;
import com.xxfc.platform.tour.feign.TourFeign; import com.xxfc.platform.tour.feign.TourFeign;
import com.xxfc.platform.universal.feign.ThirdFeign; import com.xxfc.platform.universal.feign.ThirdFeign;
import com.xxfc.platform.vehicle.common.RestResponse; import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.feign.VehicleFeign; import com.xxfc.platform.vehicle.feign.VehicleFeign;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.assertj.core.util.Lists;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -55,6 +59,9 @@ public class OrderCancelBiz { ...@@ -55,6 +59,9 @@ public class OrderCancelBiz {
@Autowired @Autowired
OrderMsgBiz orderMsgBiz; OrderMsgBiz orderMsgBiz;
@Autowired
OrderCalculateBiz orderCalculateBiz;
@Autowired @Autowired
UserFeign userFeign; UserFeign userFeign;
...@@ -67,6 +74,9 @@ public class OrderCancelBiz { ...@@ -67,6 +74,9 @@ public class OrderCancelBiz {
@Autowired @Autowired
ThirdFeign thirdFeign; ThirdFeign thirdFeign;
@Autowired
ActivityFeign activityFeign;
private static Map<Integer, List<Integer>> cancelAble; private static Map<Integer, List<Integer>> cancelAble;
static { static {
cancelAble = new HashMap<Integer, List<Integer>>(); cancelAble = new HashMap<Integer, List<Integer>>();
...@@ -110,28 +120,41 @@ public class OrderCancelBiz { ...@@ -110,28 +120,41 @@ public class OrderCancelBiz {
setOrderId(baseOrder.getId()); setOrderId(baseOrder.getId());
}}); }});
OrderItem orderItem = orderItemBiz.selectOne(new OrderItem(){{
setType(ItemTypeEnum.VEHICLE_MODEL.getCode());
setOrderId(baseOrder.getId());
}});
//原退还押金 //原退还押金
Integer freeDays = (null == orderItem.getCutNum())?0 :orderItem.getCutNum();
BigDecimal freeDayAmount = BigDecimal.ZERO; BigDecimal freeDayAmount = BigDecimal.ZERO;
//判断是否使用免费天数,并且进行扣款
if(null != orvd.getFreeDays() && orvd.getFreeDays() > 0) {
OrderItem orderItem = orderItemBiz.selectOne(new OrderItem(){{
setType(ItemTypeEnum.VEHICLE_MODEL.getCode());
setOrderId(baseOrder.getId());
}});
freeDayAmount = orderItem.getUnitPrice().multiply(new BigDecimal(orvd.getFreeDays()+ ""));
}
//如果超过出发时间,不能取消订单 //如果超过出发时间,不能取消订单
//根据时间处理goodsAmount //根据时间处理goodsAmount
//获取出发时间 到现在 距离时间 //获取出发时间 到现在 距离时间
Long timeLag = orvd.getStartTime() - System.currentTimeMillis(); Long timeLag = orvd.getStartTime() - System.currentTimeMillis();
//后面允许开始时间过后可以取消订单 if(timeLag < 0 ) {
// if(timeLag < 0) { //计算:使用天数 当前时间 - 开始时间的0时0分0秒
// throw new BaseException(ResultCode.FAILED_CODE, new HashSet<String>(){{ Long useTimeLag = System.currentTimeMillis() - orvd.getStartTime();
// add("已超过出发时间,不能取消订单"); Integer useDays = new BigDecimal(useTimeLag + "").divide(new BigDecimal((24 * 60 * 60 * 1000)+ "")).setScale(0, BigDecimal.ROUND_UP).intValue();
// }}); orderCalculateBiz.inProgressCalculate(baseOrder, orderItem, freeDays, useDays);
// }
}else {
//没到出车时间
//判断是否使用免费天数,并且进行扣款
if(freeDays > 0) {
freeDayAmount = orderItem.getUnitPrice().multiply(new BigDecimal(orvd.getFreeDays()+ ""));
//违约金封顶 租车身份价 * 2天
BigDecimal topAmount = orderItem.getUnitPrice().multiply(new BigDecimal("2"));
if(freeDayAmount.compareTo(topAmount) > 0) {
freeDayAmount = freeDayAmount;
}
}
}
//退款流程 //退款流程
//退订单款 //退订单款
......
...@@ -19,5 +19,5 @@ public interface DailyTravelOrderStatisticsMapper extends Mapper<DailyTravelOrde ...@@ -19,5 +19,5 @@ public interface DailyTravelOrderStatisticsMapper extends Mapper<DailyTravelOrde
List<DailyTravelOrderStatistics> getTravelPenalSum(@Param("day") Integer day); List<DailyTravelOrderStatistics> getTravelPenalSum(@Param("day") Integer day);
OrderStatistics monthOrderTotal(Integer branchCompanyId); OrderStatistics monthOrderTotal(@Param("companyId")Integer companyId);
} }
...@@ -25,5 +25,5 @@ public interface DailyVehicleOrderStatisticsMapper extends Mapper<DailyVehicleOr ...@@ -25,5 +25,5 @@ public interface DailyVehicleOrderStatisticsMapper extends Mapper<DailyVehicleOr
List<DailyVehicleOrderStatistics> getViolationMoney(@Param("day") Integer day); List<DailyVehicleOrderStatistics> getViolationMoney(@Param("day") Integer day);
OrderStatistics monthOrderTotal(Integer companyId); OrderStatistics monthOrderTotal(@Param("companyId")Integer companyId);
} }
...@@ -52,6 +52,11 @@ public class OrderStatisticsController extends BaseController<OrderStatisticsBiz ...@@ -52,6 +52,11 @@ public class OrderStatisticsController extends BaseController<OrderStatisticsBiz
*/ */
private final Integer TYPE_TOTAL = 4; private final Integer TYPE_TOTAL = 4;
/**
* 数据权限
*/
private final Integer DATA_AUTHORITY=1;
@Autowired @Autowired
private DailyVehicleOrderStatisticsBiz vehicleBiz; private DailyVehicleOrderStatisticsBiz vehicleBiz;
...@@ -77,6 +82,10 @@ public class OrderStatisticsController extends BaseController<OrderStatisticsBiz ...@@ -77,6 +82,10 @@ public class OrderStatisticsController extends BaseController<OrderStatisticsBiz
UserDTO user = userDTOObjectRestResponse.getData(); UserDTO user = userDTOObjectRestResponse.getData();
Integer companyId = user.getCompanyId(); Integer companyId = user.getCompanyId();
if (DATA_AUTHORITY.equals(user.getDataAll())){
companyId=null;
}
if (TYPE_VEHICLE.equals(type)) { if (TYPE_VEHICLE.equals(type)) {
OrderStatistics vehicle = vehicleBiz.findAll(companyId); OrderStatistics vehicle = vehicleBiz.findAll(companyId);
return ObjectRestResponse.succ(vehicle); return ObjectRestResponse.succ(vehicle);
......
...@@ -16,33 +16,37 @@ ...@@ -16,33 +16,37 @@
</select> </select>
<select id="monthOrderTotal" resultType="com.xxfc.platform.order.entity.OrderStatistics"> <select id="monthOrderTotal" resultType="com.xxfc.platform.order.entity.OrderStatistics">
SELECT SELECT
IFNULL(sum(gmv),0) as totalGmv IFNULL(sum(gmv),0) as totalGmv
FROM FROM
( (
SELECT SELECT
ANY_VALUE(id) AS id , ANY_VALUE(id) AS id ,
ANY_VALUE(branch_company_id) AS branch_company_id, ANY_VALUE(branch_company_id) AS branch_company_id,
ANY_VALUE(one_day) AS one_day, ANY_VALUE(one_day) AS one_day,
ANY_VALUE(gmv) AS gmv, ANY_VALUE(gmv) AS gmv,
ANY_VALUE(crt_time) AS crt_time ANY_VALUE(crt_time) AS crt_time
FROM FROM
daily_members_order_statistics daily_members_order_statistics
GROUP BY GROUP BY
one_day,branch_company_id one_day,branch_company_id
) m ) m
WHERE WHERE
branch_company_id =#{companyId} 1=1
<if test="companyId != null">
and branch_company_id =#{companyId}
</if>
</select> </select>
<!-- <select id="updateByExampleSelective">--> <!-- <select id="updateByExampleSelective">-->
<!-- SELECT--> <!-- SELECT-->
<!-- IFNULL(sum(gmv),0) as totalGmv--> <!-- IFNULL(sum(gmv),0) as totalGmv-->
<!-- FROM--> <!-- FROM-->
<!-- daily_members_order_statistics--> <!-- daily_members_order_statistics-->
<!-- WHERE--> <!-- WHERE-->
<!-- branch_company_id =#{companyId}--> <!-- branch_company_id =#{companyId}-->
<!-- and--> <!-- and-->
<!-- DATE_FORMAT(one_day,'%Y-%c')=DATE_FORMAT(DATE_SUB(NOW(),interval 1 day),'%Y-%c')--> <!-- DATE_FORMAT(one_day,'%Y-%c')=DATE_FORMAT(DATE_SUB(NOW(),interval 1 day),'%Y-%c')-->
<!-- </select>--> <!-- </select>-->
</mapper> </mapper>
\ No newline at end of file
...@@ -55,31 +55,34 @@ ...@@ -55,31 +55,34 @@
IFNULL(sum(penal_sum) ,0) as totalPenalSum IFNULL(sum(penal_sum) ,0) as totalPenalSum
FROM FROM
( (
SELECT SELECT
ANY_VALUE(id) AS id, ANY_VALUE(id) AS id,
ANY_VALUE(branch_company_id) AS branch_company_id, ANY_VALUE(branch_company_id) AS branch_company_id,
ANY_VALUE(one_day) AS one_day, ANY_VALUE(one_day) AS one_day,
ANY_VALUE(gmv) AS gmv, ANY_VALUE(gmv) AS gmv,
ANY_VALUE(penal_sum) AS penal_sum, ANY_VALUE(penal_sum) AS penal_sum,
ANY_VALUE(crt_time) AS crt_time ANY_VALUE(crt_time) AS crt_time
FROM FROM
daily_travel_order_statistics daily_travel_order_statistics
GROUP BY GROUP BY
one_day,branch_company_id one_day,branch_company_id
) o ) o
WHERE WHERE
branch_company_id =#{companyId} 1=1
<if test="companyId != null">
and branch_company_id =#{companyId}
</if>
</select> </select>
<!-- <select id="updateByExampleSelective">--> <!-- <select id="updateByExampleSelective">-->
<!-- SELECT--> <!-- SELECT-->
<!-- IFNULL(sum(gmv),0) as totalGmv,--> <!-- IFNULL(sum(gmv),0) as totalGmv,-->
<!-- IFNULL(sum(penal_sum) ,0) as totalPenalSum--> <!-- IFNULL(sum(penal_sum) ,0) as totalPenalSum-->
<!-- FROM--> <!-- FROM-->
<!-- daily_travel_order_statistics--> <!-- daily_travel_order_statistics-->
<!-- WHERE--> <!-- WHERE-->
<!-- branch_company_id =#{branchCompanyId}--> <!-- branch_company_id =#{branchCompanyId}-->
<!-- AND--> <!-- AND-->
<!-- DATE_FORMAT(one_day,'%Y-%c')=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%c')--> <!-- DATE_FORMAT(one_day,'%Y-%c')=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%c')-->
<!-- </select>--> <!-- </select>-->
</mapper> </mapper>
\ No newline at end of file
...@@ -80,6 +80,40 @@ ...@@ -80,6 +80,40 @@
</select> </select>
<!-- 获取赔偿和延期JSON字符串--> <!-- 获取赔偿和延期JSON字符串-->
<select id="monthOrderTotal" resultType="com.xxfc.platform.order.entity.OrderStatistics">
SELECT
IFNULL(sum(gmv),0) as totalGmv,
(IFNULL(sum(security_deposit),0)-IFNULL(sum(refund_security_deposit) ,0)) as totalSecurityDeposit,
IFNULL(sum(refund_security_deposit) ,0) as totalRefundSecurityDeposit,
IFNULL(sum(compensation) ,0) as totalCompensation,
IFNULL(sum(forfeit) ,0) as totalForfeit,
IFNULL(sum(penal_sum) ,0) as totalPenalSum,
IFNULL(sum(postpone) ,0) as totalPostpone
FROM
(
SELECT
ANY_VALUE(id) as id,
one_day,
branch_company_id,
ANY_VALUE(gmv) AS gmv,
ANY_VALUE(security_deposit) AS security_deposit,
ANY_VALUE(refund_security_deposit) AS refund_security_deposit,
ANY_VALUE(forfeit) AS forfeit,ANY_VALUE(penal_sum) AS penal_sum,
ANY_VALUE(postpone) AS postpone,ANY_VALUE(crt_time) AS crt_time,
ANY_VALUE(compensation) AS compensation
FROM
daily_vehicle_order_statistics
GROUP BY
one_day,branch_company_id
) a
WHERE
1=1
<if test="companyId != null">
and branch_company_id = #{companyId}
</if>
</select>
<!--违章-->
<select id="getCompensationAndPostpone" resultType="HashMap"> <select id="getCompensationAndPostpone" resultType="HashMap">
SELECT SELECT
v.start_company_id AS branchCompanyId, v.start_company_id AS branchCompanyId,
...@@ -105,7 +139,7 @@ ...@@ -105,7 +139,7 @@
order by v.start_company_id asc order by v.start_company_id asc
</select> </select>
<!--违章-->
<select id="getViolationMoney" resultType="com.xxfc.platform.order.entity.DailyVehicleOrderStatistics"> <select id="getViolationMoney" resultType="com.xxfc.platform.order.entity.DailyVehicleOrderStatistics">
SELECT SELECT
d.start_company_id AS branchCompanyId, d.start_company_id AS branchCompanyId,
...@@ -136,37 +170,6 @@ ...@@ -136,37 +170,6 @@
d.start_company_id d.start_company_id
</select> </select>
<select id="monthOrderTotal" resultType="com.xxfc.platform.order.entity.OrderStatistics">
SELECT
IFNULL(sum(gmv),0) as totalGmv,
(IFNULL(sum(security_deposit),0)-IFNULL(sum(refund_security_deposit) ,0)) as totalSecurityDeposit,
IFNULL(sum(refund_security_deposit) ,0) as totalRefundSecurityDeposit,
IFNULL(sum(compensation) ,0) as totalCompensation,
IFNULL(sum(forfeit) ,0) as totalForfeit,
IFNULL(sum(penal_sum) ,0) as totalPenalSum,
IFNULL(sum(postpone) ,0) as totalPostpone
FROM
(
SELECT
ANY_VALUE(id) as id,
one_day,
branch_company_id,
ANY_VALUE(gmv) AS gmv,
ANY_VALUE(security_deposit) AS security_deposit,
ANY_VALUE(refund_security_deposit) AS refund_security_deposit,
ANY_VALUE(forfeit) AS forfeit,ANY_VALUE(penal_sum) AS penal_sum,
ANY_VALUE(postpone) AS postpone,ANY_VALUE(crt_time) AS crt_time,
ANY_VALUE(compensation) AS compensation
FROM
daily_vehicle_order_statistics
GROUP BY
one_day,branch_company_id
) a
WHERE
branch_company_id = #{companyId}
</select>
<!-- <select id="updateByExampleSelective">--> <!-- <select id="updateByExampleSelective">-->
<!-- SELECT--> <!-- SELECT-->
<!-- IFNULL(sum(gmv),0) as totalGmv,--> <!-- IFNULL(sum(gmv),0) as totalGmv,-->
......
...@@ -112,4 +112,7 @@ public class TourGoodDTO { ...@@ -112,4 +112,7 @@ public class TourGoodDTO {
@ApiModelProperty(value = "海报背景") @ApiModelProperty(value = "海报背景")
private String posterBackground; private String posterBackground;
@ApiModelProperty("seo*html标签优化")
private String alt;
} }
...@@ -134,4 +134,7 @@ public class TourGood implements Serializable { ...@@ -134,4 +134,7 @@ public class TourGood implements Serializable {
@Column(name = "poster_background") @Column(name = "poster_background")
@ApiModelProperty(value = "海报背景") @ApiModelProperty(value = "海报背景")
private String posterBackground; private String posterBackground;
@ApiModelProperty("seo*html标签优化")
private String alt;
} }
...@@ -129,6 +129,8 @@ public class TourGoodDetailVo { ...@@ -129,6 +129,8 @@ public class TourGoodDetailVo {
List<GoodTagDTO> tagDTOS; List<GoodTagDTO> tagDTOS;
private String posterBackground; private String posterBackground;
@ApiModelProperty("seo*html标签优化")
private String alt;
} }
package com.xxfc.platform.uccn.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/6 10:47
*/
@Data
@Builder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
public class FriendLinkDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
/**
* 连接地址
*/
private String linkUrl;
/**
* 名称
*/
private String name;
/**
* 简要说明
*/
private String brief;
/**
* 排序
*/
private Integer rank;
/**
* 创建者id
*/
private Integer crtUser;
/**
* 上架状态 上架:true 下架:false
*/
private Boolean onState;
/**
* 平台 1:欣新房车官网 2:滴房车官网 0:无限制
*/
private Integer platform;
}
package com.xxfc.platform.uccn.dto;
import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/6 12:05
*/
@Data
@Builder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor
public class FriendLinkFindDTO extends PageParam {
private String name;
private Boolean onState;
}
package com.xxfc.platform.uccn.dto;
import com.xxfc.platform.uccn.entity.Model;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@NoArgsConstructor
public class ModelDto {
private Model parent;
private List<Model> list;
public ModelDto(Model parent, List<Model> list) {
this.parent = parent;
this.list = list;
}
}
package com.xxfc.platform.uccn.dto;
import com.xxfc.platform.uccn.entity.SEO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
@Data
@Api
public class SeoDTO extends SEO {
@Column(name = "modeName")
@ApiModelProperty(value = "模块名称")
private String modelName;
@Column(name = "model_id")
@ApiModelProperty(value = "模块id")
private Integer modelId;
}
...@@ -103,4 +103,7 @@ public class SummitActivitySaveDTO implements Serializable { ...@@ -103,4 +103,7 @@ public class SummitActivitySaveDTO implements Serializable {
@ApiModelProperty(value = "排序") @ApiModelProperty(value = "排序")
private Integer rank; private Integer rank;
@ApiModelProperty("seo*html标签优化")
private String alt;
} }
...@@ -3,14 +3,12 @@ package com.xxfc.platform.uccn.entity; ...@@ -3,14 +3,12 @@ package com.xxfc.platform.uccn.entity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import tk.mybatis.mapper.annotation.KeySql; import tk.mybatis.mapper.annotation.KeySql;
import tk.mybatis.mapper.code.IdentityDialect; import tk.mybatis.mapper.code.IdentityDialect;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.util.Date; import java.util.Date;
...@@ -108,7 +106,7 @@ public class Article { ...@@ -108,7 +106,7 @@ public class Article {
private Integer status; private Integer status;
@Column(name ="type") @Column(name = "type")
@ApiModelProperty(value = "文章发布网站:0-所有,1-新欣房车官网,2-滴房车官网") @ApiModelProperty(value = "文章发布网站:0-所有,1-新欣房车官网,2-滴房车官网")
private Integer type; private Integer type;
...@@ -116,7 +114,7 @@ public class Article { ...@@ -116,7 +114,7 @@ public class Article {
* 创建时间 * 创建时间
*/ */
@Column(name = "cre_time") @Column(name = "cre_time")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date creTime; private Date creTime;
...@@ -125,7 +123,7 @@ public class Article { ...@@ -125,7 +123,7 @@ public class Article {
* 修改时间 * 修改时间
*/ */
@Column(name = "upd_time") @Column(name = "upd_time")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "修改时间") @ApiModelProperty(value = "修改时间")
private Date updTime; private Date updTime;
...@@ -134,9 +132,24 @@ public class Article { ...@@ -134,9 +132,24 @@ public class Article {
* 上架时间 * 上架时间
*/ */
@Column(name = "add_time") @Column(name = "add_time")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "上架时间") @ApiModelProperty(value = "上架时间")
private Date addTime; private Date addTime;
@ApiModelProperty("seo*html标签优化")
private String alt;
@Column(name = "tag_title")
@ApiModelProperty("title标签内容")
private String tagTitle;
@Column(name = "keywords")
@ApiModelProperty("title标签内容")
private String keywords;
@Column(name = "description")
@ApiModelProperty("description")
private String description;
} }
package com.xxfc.platform.uccn.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.io.Serializable;
/**
* @author libin
* @version 1.0
* @description 友情连接
* @data 2019/9/6 10:40
*/
@Data
@Entity
@Table(name = "friend_link")
@Builder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
public class FriendLink implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(generator = "JDBC")
private Long id;
/**
* 连接地址
*/
@Column(name = "link_url")
private String linkUrl;
/**
* 名称
*/
private String name;
/**
* 简要说明
*/
private String brief;
/**
* 排序
*/
private Integer rank;
/**
* 创建时间
*/
@Column(name = "crt_time")
private Long crtTime;
/**
* 更新时间
*/
@Column(name = "upd_time")
private Long updTime;
/**
* 发布时间
*/
@Column(name = "publish_time")
private Long publishTime;
/**
* 删除状态 true:正常 1:删除
*/
@Column(name = "is_del")
private Boolean isDel;
/**
* 创建者id
*/
@Column(name = "crt_user")
private Integer crtUser;
/**
* 上架状态 上架:true 下架:false
*/
@Column(name = "on_state")
private Boolean onState;
/**
* 平台 1:欣新房车官网 2:滴房车官网 0:无限制
*/
private Integer platform;
}
package com.xxfc.platform.uccn.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javafx.scene.input.Mnemonic;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@Data
@Table(name = "model")
@ApiModel(value = "官网模块实体")
@NoArgsConstructor
public class Model implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(value = "主键")
private Integer id;
@Column(name = "parent_id")
@ApiModelProperty(value = "父模块id")
private Integer parentId;
@Column(name = "name")
@ApiModelProperty(value = "模块名称")
private String name;
@Column(name = "level")
@ApiModelProperty(value = "模块等级")
private Integer level;
@Column(name = "cre_time")
@ApiModelProperty(value = " 创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date creTime;
@Column(name = "upd_time")
@ApiModelProperty(value = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updTime;
@Column(name = "is_del")
@ApiModelProperty(value = "是否删除")
private Integer isDel;
@Column(name = "rank")
@ApiModelProperty(value = "排序")
private Integer rank;
public Model(Integer id) {
this.id = id;
}
}
package com.xxfc.platform.uccn.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*;
import java.util.Date;
@Data
@Table(name = "seo")
@ApiModel(value = "seo列表实体")
@NoArgsConstructor
public class SEO {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(value = "主键")
private Integer id;
@Column(name = "model_id")
@ApiModelProperty(value = "模块id")
private Integer modelId;
@Column(name = "title")
@ApiModelProperty(value = "title内容")
private String title;
@Column(name = "keywords")
@ApiModelProperty(value = "关键子")
private String keywords;
@Column(name = "description")
@ApiModelProperty(value = "description内容")
private String description;
@Column(name = "header")
@ApiModelProperty(value = "标题")
private String header;
@Column(name = "cre_time")
@ApiModelProperty(value = " 创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date creTime;
@Column(name = "upd_time")
@ApiModelProperty(value = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updTime;
}
...@@ -241,4 +241,7 @@ public class SummitActivity implements Serializable { ...@@ -241,4 +241,7 @@ public class SummitActivity implements Serializable {
@ApiModelProperty(value = "排序") @ApiModelProperty(value = "排序")
private Integer rank; private Integer rank;
@ApiModelProperty("seo*html标签优化")
private String alt;
} }
package com.xxfc.platform.uccn.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/6 10:53
*/
@Data
@Builder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
public class FriendLinkAdminVO implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
/**
* 连接地址
*/
private String linkUrl;
/**
* 名称
*/
private String name;
/**
* 简要说明
*/
private String brief;
/**
* 排序
*/
private Integer rank;
/**
* 创建时间
*/
private Long crtTime;
/**
* 发布时间
*/
private Long publishTime;
/**
* 创建者id
*/
private Integer crtUser;
/**
* 上架状态 上架:true 下架:false
*/
private Boolean onState;
/**
* 平台 1:欣新房车官网 2:滴房车官网 0:无限制
*/
private Integer platform;
}
package com.xxfc.platform.uccn.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/6 10:51
*/
@Data
@Builder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
public class FriendLinkVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 连接地址
*/
private String linkUrl;
/**
* 名称
*/
private String name;
/**
* 简要说明
*/
private String brief;
}
package com.xxfc.platform.uccn.vo;
import lombok.Data;
/**
* @author Administrator
*/
@Data
public class ModelQuery {
private Integer page = 1;
private Integer limit = 10;
}
package com.xxfc.platform.uccn.vo;
import com.xxfc.platform.uccn.entity.Model;
import lombok.Data;
import java.util.List;
@Data
public class ModelVo {
private Integer parentId;
private List<Model> list;
}
package com.xxfc.platform.uccn.vo;
import lombok.Data;
/**
* @author Administrator
*/
@Data
public class SEOQuery {
private Integer page = 1;
private Integer limit = 10;
}
package com.xxfc.platform.uccn.vo;
import com.xxfc.platform.uccn.entity.SEO;
import lombok.Data;
@Data
public class SEOVo extends SEO {
}
...@@ -122,4 +122,7 @@ public class SummitActivityAdminVo implements Serializable { ...@@ -122,4 +122,7 @@ public class SummitActivityAdminVo implements Serializable {
@ApiModelProperty(value = "排序") @ApiModelProperty(value = "排序")
private Integer rank; private Integer rank;
@ApiModelProperty("seo*html标签优化")
private String alt;
} }
...@@ -83,4 +83,6 @@ public class SummitActivityDetailVo implements Serializable { ...@@ -83,4 +83,6 @@ public class SummitActivityDetailVo implements Serializable {
@JsonIgnore @JsonIgnore
private Integer willNum; private Integer willNum;
@ApiModelProperty("seo*html标签优化")
private String alt;
} }
...@@ -58,4 +58,7 @@ public class SummitActivityVo implements Serializable { ...@@ -58,4 +58,7 @@ public class SummitActivityVo implements Serializable {
@ApiModelProperty(value = "排序") @ApiModelProperty(value = "排序")
@JsonIgnore @JsonIgnore
private Integer rank; private Integer rank;
@ApiModelProperty("seo*html标签优化")
private String alt;
} }
package com.xxfc.platform.uccn.vo; package com.xxfc.platform.uccn.vo;
import lombok.Data;
public enum TypeEnum { public enum TypeEnum {
VEHICLE(1, "车型"), VEHICLE(1, "车型"),
TOUR(2, "旅游"), TOUR(2, "旅游"),
......
...@@ -3,6 +3,7 @@ package com.xxfc.platform.uccn.biz; ...@@ -3,6 +3,7 @@ package com.xxfc.platform.uccn.biz;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.xxfc.platform.uccn.comstnt.UrlType; import com.xxfc.platform.uccn.comstnt.UrlType;
import com.xxfc.platform.uccn.entity.Article; import com.xxfc.platform.uccn.entity.Article;
import com.xxfc.platform.uccn.mapper.ArticleMapper; import com.xxfc.platform.uccn.mapper.ArticleMapper;
...@@ -64,7 +65,8 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> { ...@@ -64,7 +65,8 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
if (UrlType.OFFICIAL_WEBSITE.getCode().equals(urlType)) { if (UrlType.OFFICIAL_WEBSITE.getCode().equals(urlType)) {
criteria.andEqualTo("status", 1); criteria.andEqualTo("status", 1);
} }
return mapper.selectOneByExample(example); Article article = mapper.selectOneByExample(example);
return article;
} }
...@@ -118,6 +120,10 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> { ...@@ -118,6 +120,10 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
// } // }
} }
/**
* 添加文章
* @param article
*/
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void add(Article article) { public void add(Article article) {
if (article == null) { if (article == null) {
...@@ -132,6 +138,10 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> { ...@@ -132,6 +138,10 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
article.setType(0); article.setType(0);
} }
if (article.getTagTitle()==null||article.getKeywords()==null||article.getDescription()==null) {
throw new BaseException("必须设置seo");
}
if (article.getStatus()==1){ if (article.getStatus()==1){
article.setAddTime(new Date()); article.setAddTime(new Date());
} }
...@@ -140,6 +150,11 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> { ...@@ -140,6 +150,11 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
} }
/**
* 后台文章列表
* @param query
* @return
*/
public PageInfo findAll(ArticleQuery query) { public PageInfo findAll(ArticleQuery query) {
PageHelper.startPage(query.getPage(),query.getLimit()); PageHelper.startPage(query.getPage(),query.getLimit());
Example exa = Example.builder(Article.class).where( Example exa = Example.builder(Article.class).where(
...@@ -151,13 +166,22 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> { ...@@ -151,13 +166,22 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
return PageInfo.of(articles); return PageInfo.of(articles);
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public int updateSelectiveByIdRe(Article article){ public int updateSelectiveByIdRe(Article article){
article.setUpdTime(new Date()); article.setUpdTime(new Date());
if (article.getTagTitle()==null||article.getKeywords()==null||article.getDescription()==null) {
throw new BaseException("必须设置seo");
}
return mapper.updateByPrimaryKeySelective(article); return mapper.updateByPrimaryKeySelective(article);
} }
/**
* 上架
* @param id
* @return
*/
public int putaway(Integer id) { public int putaway(Integer id) {
Article article = new Article(); Article article = new Article();
article.setId(id); article.setId(id);
...@@ -167,6 +191,11 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> { ...@@ -167,6 +191,11 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
return mapper.updateByPrimaryKeySelective(article); return mapper.updateByPrimaryKeySelective(article);
} }
/**
* 下架
* @param id
* @return
*/
public int soldOut(Integer id) { public int soldOut(Integer id) {
Article article = new Article(); Article article = new Article();
article.setId(id); article.setId(id);
...@@ -175,6 +204,11 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> { ...@@ -175,6 +204,11 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
return mapper.updateByPrimaryKeySelective(article); return mapper.updateByPrimaryKeySelective(article);
} }
/**
* 删除
* @param id
* @return
*/
public int remove(Integer id) { public int remove(Integer id) {
Article article = new Article(); Article article = new Article();
article.setId(id); article.setId(id);
......
package com.xxfc.platform.uccn.biz;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.uccn.dto.FriendLinkDTO;
import com.xxfc.platform.uccn.dto.FriendLinkFindDTO;
import com.xxfc.platform.uccn.entity.FriendLink;
import com.xxfc.platform.uccn.mapper.FriendLinkMapper;
import com.xxfc.platform.uccn.vo.FriendLinkAdminVO;
import com.xxfc.platform.uccn.vo.FriendLinkVO;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import tk.mybatis.mapper.entity.Example;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/6 10:57
*/
@Service
public class FriendLinkBiz extends BaseBiz<FriendLinkMapper, FriendLink> {
/**
* 保存编辑
* @param friendLinkDTO
*/
public void saveFriendLink(FriendLinkDTO friendLinkDTO) {
FriendLink friendLink = new FriendLink();
BeanUtils.copyProperties(friendLinkDTO, friendLink);
if (friendLink.getOnState()){
friendLink.setPublishTime(Instant.now().toEpochMilli());
}
if (Objects.isNull(friendLinkDTO.getId())) {
friendLink.setCrtTime(Instant.now().toEpochMilli());
friendLink.setIsDel(false);
mapper.insertSelective(friendLink);
}else {
friendLink.setUpdTime(Instant.now().toEpochMilli());
mapper.updateByPrimaryKeySelective(friendLink);
}
}
/**
* 上下架
* @param id
*/
public void updateFriendLinkOnStateById(Long id,Boolean onState){
FriendLink friendLink = FriendLink.builder().id(id).onState(onState).updTime(Instant.now().toEpochMilli()).build();
if (onState){
friendLink.setPublishTime(Instant.now().toEpochMilli());
}
mapper.updateByPrimaryKeySelective(friendLink);
}
/**
* 删除
* @param id
*/
public void deleteFriendLinkById(Long id){
FriendLink friendLink = FriendLink.builder().id(id).updTime(Instant.now().toEpochMilli()).isDel(true).build();
mapper.updateByPrimaryKeySelective(friendLink);
}
/**
* 根据id查询
* @param id
* @return
*/
public FriendLinkDTO findFriendLinkById(Long id){
FriendLinkDTO friendLinkDTO = FriendLinkDTO.builder().build();
FriendLink friendLink = mapper.selectByPrimaryKey(id);
if (Objects.isNull(friendLink)){
return friendLinkDTO;
}
BeanUtils.copyProperties(friendLink,friendLinkDTO);
return friendLinkDTO;
}
public List<FriendLinkVO> listFriendLinkByPlatform(Integer platform){
List<FriendLinkVO> friendLinkVOS = new ArrayList<>();
Example example = new Example(FriendLink.class);
example.setOrderByClause("rank DESC,publish_time DESC");
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("isDel",0);
criteria.andEqualTo("onState",true);
criteria.andIn("platform", Arrays.asList(platform,0));
criteria.andNotEqualTo("linkUrl","");
List<FriendLink> friendLinks = mapper.selectByExample(example);
if (CollectionUtils.isEmpty(friendLinks)){
return friendLinkVOS;
}
friendLinkVOS = JSON.parseObject(JSON.toJSONString(friendLinks), new TypeReference<List<FriendLinkVO>>() {
});
return friendLinkVOS;
}
public PageDataVO<FriendLinkAdminVO> listFriendLinkWithPage(FriendLinkFindDTO friendLinkFindDTO){
PageDataVO<FriendLinkAdminVO> pageDataVO = new PageDataVO<>();
Example example = new Example(FriendLink.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("isDel",0);
if (!StringUtils.isEmpty(friendLinkFindDTO.getName())){
criteria.andLike("name",String.format("%%%s%%",friendLinkFindDTO.getName().trim()));
}
if (Objects.nonNull(friendLinkFindDTO.getOnState())){
criteria.andEqualTo("onState",friendLinkFindDTO.getOnState());
}
PageDataVO<FriendLink> friendLinkPageDataVO = PageDataVO.pageInfo(friendLinkFindDTO.getPage(),friendLinkFindDTO.getLimit(),()->mapper.selectByExample(example));
List<FriendLink> data = friendLinkPageDataVO.getData();
if (CollectionUtils.isEmpty(data)){
return pageDataVO;
}
List<FriendLinkAdminVO> friendLinkAdminVOS = new ArrayList<>();
FriendLinkAdminVO friendLinkAdminVO;
for (FriendLink friendLink : data) {
friendLinkAdminVO = new FriendLinkAdminVO();
BeanUtils.copyProperties(friendLink,friendLinkAdminVO);
friendLinkAdminVOS.add(friendLinkAdminVO);
}
pageDataVO.setData(friendLinkAdminVOS);
pageDataVO.setPageSize(friendLinkPageDataVO.getPageSize());
pageDataVO.setPageNum(friendLinkPageDataVO.getPageNum());
pageDataVO.setTotalPage(friendLinkPageDataVO.getTotalPage());
pageDataVO.setTotalCount(friendLinkPageDataVO.getTotalCount());
return pageDataVO;
}
}
package com.xxfc.platform.uccn.biz;
import com.ace.cache.annotation.Cache;
import com.ace.cache.annotation.CacheClear;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.xxfc.platform.uccn.dto.ModelDto;
import com.xxfc.platform.uccn.entity.Model;
import com.xxfc.platform.uccn.vo.ModelVo;
import com.xxfc.platform.uccn.mapper.ModelBackgroundMapper;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service
public class ModelBackgroundBiz extends BaseBiz<ModelBackgroundMapper, Model> {
private final Integer BASE_PARENT_ID = 0;
private final Integer NOT_DELETE = 0;
private final Integer level=2;
@Autowired
private ApplicationContext context;
public List<ModelDto> getList() {
List<Model> ModelList = getProxy().getListByParentId(BASE_PARENT_ID);
if (CollectionUtils.isEmpty(ModelList)) {
return new ArrayList<>();
}
return getModelDtos(ModelList);
}
/**
* 获取ModelDto集合
* @param models
* @return
*/
private ArrayList<ModelDto> getModelDtos(List<Model> models) {
ArrayList<ModelDto> modelDtos = new ArrayList<>();
for (Model el : models) {
if (el.getLevel()==3) {
break;
}
List<Model> list = getListByParentId(el.getId());
modelDtos.add(new ModelDto(el, list));
modelDtos.addAll(getModelDtos(list));
}
return modelDtos;
}
/**
* 根据父类id获取所有子类集合
*
* @param parentId
* @return
*/
// @Cache(key = "ModelList{1}")
public List<Model> getListByParentId(Integer parentId) {
Example exa = new Example(Model.class);
Example.Criteria criteria = exa.createCriteria();
criteria.andEqualTo("parentId",parentId).andEqualTo("isDel",NOT_DELETE);
exa.orderBy("rank").asc();
return mapper.selectByExample(exa);
}
/**
* 获取代理对象
*
* @return
*/
private ModelBackgroundBiz getProxy() {
return context.getBean(ModelBackgroundBiz.class);
}
/**
* 修改子模块
*
* @param Modelvo
* @return
*/
// @CacheClear(key = "ModelList{1.Integer}")
public String update(ModelVo Modelvo) {
if (Modelvo==null||Modelvo.getParentId()==null) {
return "无修改数据";
}
Model Model = selectById(Modelvo.getParentId());
if (Model==null||(!Model.getIsDel().equals(NOT_DELETE))||BASE_PARENT_ID.equals(Model.getParentId())) {
return "该标签不能修改";
}
if (CollectionUtils.isNotEmpty(Modelvo.getList())) {
for (Model el : Modelvo.getList()) {
if (el.getId()==null) {
el.setIsDel(NOT_DELETE);
el.setCreTime(new Date());
el.setParentId(Modelvo.getParentId());
if (el.getRank() == null) {
el.setRank(0);
}
mapper.insertSelective(el);
}else {
el.setUpdTime(new Date());
mapper.updateByPrimaryKeySelective(el);
}
}
}
return null;
}
}
package com.xxfc.platform.uccn.biz;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.xxfc.platform.uccn.dto.SeoDTO;
import com.xxfc.platform.uccn.entity.SEO;
import com.xxfc.platform.uccn.mapper.SEOMapper;
import com.xxfc.platform.uccn.vo.SEOQuery;
import com.xxfc.platform.uccn.vo.SEOVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtilsBean;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import tk.mybatis.mapper.entity.Example;
import java.util.Date;
import java.util.List;
/**
* @author Administrator
*/
@Service
@Slf4j
public class SEOBiz extends BaseBiz<SEOMapper, SEO> {
public PageInfo<SeoDTO> getList(SEOQuery query) {
PageHelper.startPage(query.getPage(),query.getLimit());
List<SeoDTO> seodtoList = mapper.getSEODTOList();
return PageInfo.of(seodtoList);
}
@Transactional(rollbackFor = Exception.class)
public boolean update(SEOVo seoVo) {
try {
if (seoVo==null) {
return false;
}
SEO seo = new SEO();
BeanUtilsBean.getInstance().copyProperties(seo,seoVo);
Example example = new Example(SEO.class);
example.createCriteria().andEqualTo("modelId", seo.getModelId());
List<SEO> list = mapper.selectByExample(example);
if (CollectionUtils.isEmpty(list)) {
seo.setCreTime(new Date());
mapper.insertSelective(seo);
}else if (list.size()==1){
seo.setUpdTime(new Date());
mapper.updateByPrimaryKeySelective(seo);
}else {
log.error("错误!该模块保存有多个seo");
return false;
}
return true;
} catch (Exception e) {
e.printStackTrace();
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return false;
}
}
public SEO getSeoByModelId(Integer modelId) {
SEO seo = new SEO();
seo.setModelId(modelId);
return selectOne(seo);
}
}
...@@ -187,9 +187,7 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv ...@@ -187,9 +187,7 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv
if (summitActivities.size() <= num) { if (summitActivities.size() <= num) {
for (SummitActivity summitActivity : summitActivities) { for (SummitActivity summitActivity : summitActivities) {
summitActivityVo = new SummitActivityVo(); summitActivityVo = new SummitActivityVo();
summitActivityVo.setId(summitActivity.getId()); BeanUtils.copyProperties(summitActivity,summitActivityVo);
summitActivityVo.setBanner(summitActivity.getBanner());
summitActivityVo.setTitle(summitActivity.getTitle());
summitActivityVos.add(summitActivityVo); summitActivityVos.add(summitActivityVo);
} }
} else { } else {
...@@ -198,9 +196,7 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv ...@@ -198,9 +196,7 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv
for (Integer i : resultSet) { for (Integer i : resultSet) {
summitActivityVo = new SummitActivityVo(); summitActivityVo = new SummitActivityVo();
SummitActivity summitActivity = summitActivities.get(i); SummitActivity summitActivity = summitActivities.get(i);
summitActivityVo.setId(summitActivity.getId()); BeanUtils.copyProperties(summitActivity,summitActivityVo);
summitActivityVo.setBanner(summitActivity.getBanner());
summitActivityVo.setTitle(summitActivity.getTitle());
summitActivityVos.add(summitActivityVo); summitActivityVos.add(summitActivityVo);
} }
} }
......
package com.xxfc.platform.uccn.mapper;
import com.xxfc.platform.uccn.entity.FriendLink;
import tk.mybatis.mapper.common.Mapper;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/6 10:58
*/
public interface FriendLinkMapper extends Mapper<FriendLink> {
}
package com.xxfc.platform.uccn.mapper;
import com.xxfc.platform.uccn.entity.Model;
import tk.mybatis.mapper.common.Mapper;
public interface ModelBackgroundMapper extends Mapper<Model> {
}
package com.xxfc.platform.uccn.mapper;
import com.xxfc.platform.uccn.dto.SeoDTO;
import com.xxfc.platform.uccn.entity.SEO;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface SEOMapper extends Mapper<SEO> {
List<SeoDTO> getSEODTOList();
}
package com.xxfc.platform.uccn.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.uccn.biz.FriendLinkBiz;
import com.xxfc.platform.uccn.vo.FriendLinkVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/6 10:59
*/
@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@RequestMapping("/app/unauth/friend_link")
@Api(tags = "友情链接*官网")
public class FriendLinkController {
private final FriendLinkBiz friendLinkBiz;
@ApiOperation("查询链接列表")
@GetMapping("/list")
public ObjectRestResponse<List<FriendLinkVO>> listFriendLink(@RequestParam(value = "platform",required = false,defaultValue = "1") Integer platform){
List<FriendLinkVO> friendLinkVOS = friendLinkBiz.listFriendLinkByPlatform(platform);
return ObjectRestResponse.succ(friendLinkVOS);
}
}
package com.xxfc.platform.uccn.rest;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.uccn.biz.SEOBiz;
import com.xxfc.platform.uccn.entity.SEO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author Administrator
*/
@RestController
@RequestMapping("seo")
@Api(tags={"seo后台管理类"})
public class SEOController extends BaseController<SEOBiz, SEO> {
@GetMapping("/app/unauth/officialWebsite/{modelId}")
@ApiOperation(value = "获取官网seo")
@IgnoreUserToken
public ObjectRestResponse getSeoByModelId(@PathVariable Integer modelId){
return ObjectRestResponse.succ(baseBiz.getSeoByModelId(modelId));
}
}
\ No newline at end of file
package com.xxfc.platform.uccn.rest.admin;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.uccn.biz.FriendLinkBiz;
import com.xxfc.platform.uccn.dto.FriendLinkDTO;
import com.xxfc.platform.uccn.dto.FriendLinkFindDTO;
import com.xxfc.platform.uccn.vo.FriendLinkAdminVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/6 10:59
*/
@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@RequestMapping("/admin/friend_link")
@Api(tags = "友情链接*后台")
public class FriendLinkAdminController {
private final FriendLinkBiz friendLinkBiz;
@ApiOperation("分页")
@PostMapping("/page")
public ObjectRestResponse<PageDataVO<FriendLinkAdminVO>> listFriendLinkWithPage(@RequestBody FriendLinkFindDTO friendLinkFindDTO){
PageDataVO<FriendLinkAdminVO> pageDataVO = friendLinkBiz.listFriendLinkWithPage(friendLinkFindDTO);
return ObjectRestResponse.succ(pageDataVO);
}
@ApiOperation("根据id查询")
@GetMapping("/{id}")
public ObjectRestResponse<FriendLinkDTO> findFriendLink(@PathVariable(value = "id") Long id){
FriendLinkDTO friendLinkDTO = friendLinkBiz.findFriendLinkById(id);
return ObjectRestResponse.succ(friendLinkDTO);
}
@ApiOperation("编辑或保存")
@PostMapping("/save")
public ObjectRestResponse<Void> saveFriendLink(@RequestBody FriendLinkDTO friendLinkDTO){
friendLinkBiz.saveFriendLink(friendLinkDTO);
return ObjectRestResponse.succ();
}
@ApiOperation("上下架")
@PutMapping("/on_state/{id}/{state}")
public ObjectRestResponse<Void> updateFriendLinkOnstate(@PathVariable(value = "id") Long id,@PathVariable(value = "state") Boolean state){
friendLinkBiz.updateFriendLinkOnStateById(id,state);
return ObjectRestResponse.succ();
}
@ApiOperation("删除")
@DeleteMapping("/{id}")
public ObjectRestResponse<Void> deleteFriendLink(@PathVariable(value = "id") Long id){
friendLinkBiz.deleteFriendLinkById(id);
return ObjectRestResponse.succ();
}
}
package com.xxfc.platform.uccn.rest.admin;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.uccn.biz.ModelBackgroundBiz;
import com.xxfc.platform.uccn.entity.Model;
import com.xxfc.platform.uccn.vo.ModelVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("Model")
@Api(tags={"Model后台管理类"})
public class ModelBackgroundController extends BaseController<ModelBackgroundBiz, Model> {
@GetMapping("/list")
@ApiOperation(value = "查询模块列表")
public ObjectRestResponse findList(){
return ObjectRestResponse.succ(baseBiz.getList());
}
@PutMapping("/upd")
@ApiOperation(value = "修改模块")
public ObjectRestResponse update(@RequestBody ModelVo modelvo){
String update = baseBiz.update(modelvo);
if (update==null) {
return ObjectRestResponse.succ();
}
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE,update) ;
}
}
package com.xxfc.platform.uccn.rest.admin;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.uccn.biz.SEOBiz;
import com.xxfc.platform.uccn.entity.SEO;
import com.xxfc.platform.uccn.vo.SEOQuery;
import com.xxfc.platform.uccn.vo.SEOVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
/**
* @author Administrator
*/
@RestController
@RequestMapping("seoBackground")
@Api(tags={"seo后台管理类"})
public class SEOBackgroundController extends BaseController<SEOBiz, SEO> {
@PostMapping("/list")
@ApiOperation(value = "查询模块列表")
public ObjectRestResponse findList(@RequestBody SEOQuery query){
return ObjectRestResponse.succ(baseBiz.getList(query));
}
@PutMapping("/upd")
@ApiOperation(value = "修改模块")
public ObjectRestResponse update(@RequestBody SEOVo seoVo){
boolean result = baseBiz.update(seoVo);
if (result) {
return ObjectRestResponse.succ();
}
return ObjectRestResponse.createDefaultFail() ;
}
}
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<mapper namespace="com.xxfc.platform.uccn.mapper.ArticleMapper"> <mapper namespace="com.xxfc.platform.uccn.mapper.ArticleMapper">
<select id="getArticleList" resultType="com.xxfc.platform.uccn.entity.Article"> <select id="getArticleList" resultType="com.xxfc.platform.uccn.entity.Article">
select id, title,epitome,add_time,cover_image from article select id, title,epitome,add_time,cover_image,`alt` from article
where where
is_del=0 is_del=0
and status=1 and status=1
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xxfc.platform.uccn.mapper.SEOMapper">
<select id="getSEODTOList" resultType="com.xxfc.platform.uccn.dto.SeoDTO">
select
m.name as modelName ,
m.id as model_id,
s.id,
s.title as title,
s.keywords as keywords,
s.description as description,
s.header as header
from
model m
left join
seo s
on
m.id= s.model_id
WHERE
m.is_del = 0
ORDER BY
m.`level` ASC
</select>
</mapper>
\ No newline at end of file
...@@ -72,6 +72,17 @@ ...@@ -72,6 +72,17 @@
<artifactId>junrar</artifactId> <artifactId>junrar</artifactId>
<version>0.7</version> <version>0.7</version>
</dependency> </dependency>
<!-- jpush -->
<dependency>
<groupId>cn.jpush.api</groupId>
<artifactId>jpush-client</artifactId>
<version>3.3.7</version>
</dependency>
<dependency>
<groupId>cn.jpush.api</groupId>
<artifactId>jiguang-common</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies> </dependencies>
......
package com.xxfc.platform.universal.biz;
import cn.jiguang.common.ClientConfig;
import cn.jiguang.common.resp.APIConnectionException;
import cn.jiguang.common.resp.APIRequestException;
import cn.jpush.api.JPushClient;
import cn.jpush.api.push.PushResult;
import cn.jpush.api.push.model.PushPayload;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.universal.service.SmsService;
import com.xxfc.platform.universal.utils.CCPRestSmsUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@Service
@Slf4j
public class JPushBiz {
@Value("${universal.MASTER_SECRET}")
private String MASTER_SECRET;
@Value("${universal.APP_KEY}")
private String APP_KEY;
//推送给所有平台设备
public ObjectRestResponse jpushToAllPlat(String title){
ClientConfig clientConfig = ClientConfig.getInstance();
final JPushClient jpushClient = new JPushClient(MASTER_SECRET, APP_KEY, null, clientConfig);
PushPayload payload = PushPayload.alertAll(title);
try {
PushResult result = jpushClient.sendPush(payload);
log.debug("\n推送结果:"+result);
return ObjectRestResponse.succ();
} catch (APIConnectionException e) {
// Connection error, should retry later
log.debug("\nConnection error, should retry later"+e);
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE,e.getMessage());
} catch (APIRequestException e) {
// Should review the error, and fix the request
log.debug("\nShould review the error, and fix the request"+ e);
log.debug("\nHTTP Status: " + e.getStatus());
log.debug("\nError Code: " + e.getErrorCode());
log.debug("\nError Message: " + e.getErrorMessage());
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE,e.getMessage());
}
}
}
package com.xxfc.platform.universal.controller;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.universal.biz.JPushBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 极光推送
*/
@RestController
@RequestMapping("jpush")
@IgnoreUserToken
public class JPushController {
@Autowired
JPushBiz jPushBiz;
@RequestMapping(value = "/app/unauth/all", method = RequestMethod.GET) //匹配的是href中的download请求
public ObjectRestResponse sendSms(@RequestParam("title") String title) throws Exception {
return jPushBiz.jpushToAllPlat(title);
}
}
package com.xxfc.platform.vehicle.entity; package com.xxfc.platform.vehicle.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
/** /**
...@@ -164,4 +166,7 @@ public class VehicleModel implements Serializable { ...@@ -164,4 +166,7 @@ public class VehicleModel implements Serializable {
@Column(name = "intro") @Column(name = "intro")
@ApiModelProperty(value = "简介") @ApiModelProperty(value = "简介")
private String intro; private String intro;
@ApiModelProperty("seo*html标签优化")
private String alt;
} }
package com.xxfc.platform.vehicle.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Data
@Table(name = "vehicle_user_reserve")
public class VehicleUserReserve {
@Id
@GeneratedValue(generator = "JDBC")
@ApiModelProperty("主键id")
private Integer id;
@Column(name = "user_id")
@ApiModelProperty("用户id")
private Integer userId;
@Column(name = "mode_id")
@ApiModelProperty("车型id")
private Integer modeId;
@ApiModelProperty("预定姓名")
private String name;
@ApiModelProperty("电话")
private String phone;
@Column(name = "start_time")
@ApiModelProperty("开始时间")
private Long startTime;
@Column(name = "end_time")
@ApiModelProperty("结束时间")
private Long endTime;
@Column(name = "addr_province")
@ApiModelProperty("地址-省/直辖市(编码)")
private Integer addrProvince;
@Column(name = "province_name")
@ApiModelProperty("省名称")
private String provinceName;
@Column(name = "addr_city")
@ApiModelProperty("市编号")
private Integer addrCity;
@Column(name = "city_name")
@ApiModelProperty("市名称")
private String cityName;
@Column(name = "company_id")
@ApiModelProperty("分公司id")
private Integer companyId;
@Column(name = "crt_time")
@ApiModelProperty("创建时间")
private Long crtTime;
@Column(name = "upd_time")
@ApiModelProperty("更新时间")
private Long updTime;
@ApiModelProperty("0-未处理;1-处理中;2-已处理")
private Integer status;
@Column(name = "is_del")
@ApiModelProperty("是否删除:0-正常;1-删除")
private Integer isDel;
}
\ No newline at end of file
...@@ -53,4 +53,7 @@ public class VehicleModelVo extends VehicleModel implements Serializable { ...@@ -53,4 +53,7 @@ public class VehicleModelVo extends VehicleModel implements Serializable {
*/ */
List<VehiclePlatCata> UccnCataList; List<VehiclePlatCata> UccnCataList;
@ApiModelProperty("seo*html标签优化")
private String alt;
} }
package com.xxfc.platform.vehicle.pojo.dto;
import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.Data;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/23 12:18
*/
@Data
public class VehicleUserReserveDTO extends PageParam {
}
package com.xxfc.platform.vehicle.pojo.vo;
import com.xxfc.platform.vehicle.entity.VehicleUserReserve;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/23 12:18
*/
@Data
public class VehicleUserReserveVo extends VehicleUserReserve {
@ApiModelProperty("车型名称")
private String modelName;
}
package com.xxfc.platform.vehicle.biz;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.vehicle.entity.*;
import com.xxfc.platform.vehicle.mapper.VehicleUserReserveMapper;
import com.xxfc.platform.vehicle.pojo.dto.VehicleUserReserveDTO;
import com.xxfc.platform.vehicle.pojo.vo.VehicleUserReserveVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@Service
@Slf4j
public class VehicleUserReserveBiz extends BaseBiz<VehicleUserReserveMapper, VehicleUserReserve> {
//获取列表
public ObjectRestResponse getList(VehicleUserReserveDTO reserveDTO){
Integer page=1;
Integer limit=10;
if (reserveDTO.getPage()!=null&&reserveDTO.getPage()>0){
page=reserveDTO.getPage();
}
if (reserveDTO.getLimit()!=null&&reserveDTO.getLimit()>0){
limit=reserveDTO.getLimit();
}
return ObjectRestResponse.succ(PageDataVO.pageInfo(page, limit, ()->mapper.getList(reserveDTO)));
}
//新增预定
public ObjectRestResponse updReserve(VehicleUserReserveVo reserveVo){
if (reserveVo==null){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE,"参数不能为空");
}
VehicleUserReserve userReserve=new VehicleUserReserveVo();
BeanUtils.copyProperties(reserveVo,userReserve);
insertSelective(userReserve);
return ObjectRestResponse.succ();
}
}
package com.xxfc.platform.vehicle.mapper;
import com.xxfc.platform.vehicle.entity.VehicleUserReserve;
import com.xxfc.platform.vehicle.pojo.dto.VehicleUserReserveDTO;
import com.xxfc.platform.vehicle.pojo.vo.VehicleUserReserveVo;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface VehicleUserReserveMapper extends Mapper<VehicleUserReserve> {
//获取预约列表
List<VehicleUserReserveVo> getList(VehicleUserReserveDTO reserveDTO);
}
\ No newline at end of file
package com.xxfc.platform.vehicle.rest;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.vehicle.biz.VehicleUserReserveBiz;
import com.xxfc.platform.vehicle.common.BaseController;
import com.xxfc.platform.vehicle.pojo.dto.VehicleUserReserveDTO;
import com.xxfc.platform.vehicle.pojo.vo.VehicleUserReserveVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
@RestController
@IgnoreClientToken
@RequestMapping("reserve")
public class VehicleUserReserveController extends BaseController<VehicleUserReserveBiz> {
@ApiOperation("查询预定列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public ObjectRestResponse getList(VehicleUserReserveDTO reserveDTO){
return baseBiz.getList(reserveDTO);
}
@ApiOperation("添加预定信息")
@IgnoreUserToken
@RequestMapping(value = "/app/unauth/updReserve", method = RequestMethod.POST)
public ObjectRestResponse updReserve(@RequestBody VehicleUserReserveVo reserveVo){
return baseBiz.updReserve(reserveVo);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.xxfc.platform.vehicle.mapper.VehicleUserReserveMapper" >
<select id="getList" parameterType="com.xxfc.platform.vehicle.pojo.dto.VehicleUserReserveDTO" resultType="com.xxfc.platform.vehicle.pojo.vo.VehicleUserReserveVo">
SELECT
r.id,
r.user_id as userId,
r.mode_id as modeId,
r.`name`,
r.phone,
r.start_time as startTime,
r.end_time as endTime,
r.addr_province as addrProvince,
r.province_name as provinceName,
r.addr_city as addrCity,
r.city_name as cityName,
r.company_id as companyId,
r.crt_time as crtTime,
r.upd_time as updTime,
r.`status`,
m.`name` as modelName
FROM vehicle_user_reserve r
LEFT JOIN vehicle_model m ON r.mode_id=m.id
<where>
r.is_del=0
</where>
order by r.upd_time desc
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment