Commit ce099616 authored by libin's avatar libin

Merge branch 'dev' into base-modify

# Conflicts:
#	xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/biz/ArticleBiz.java
parents c94a1bb2 417446b7
......@@ -18,7 +18,7 @@ import lombok.NoArgsConstructor;
public class CustomerServiceDTO {
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.Builder;
import lombok.Data;
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.Field;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Table;
/**
* @author libin
* @version 1.0
......@@ -18,11 +23,15 @@ import org.springframework.data.mongodb.core.mapping.Field;
@Builder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "customer_service")
@Document(collection = "customer_service")
public class CustomerService {
private static final long serialVersionUID = 1L;
@Id
private String id;
@javax.persistence.Id
@GeneratedValue(generator = "JDBC")
private Long id;
/**
* 客服名称
*/
......@@ -35,21 +44,25 @@ public class CustomerService {
* App id
*/
@Field("app_user_id")
@Column(name = "app_user_id")
private Integer appUserId;
/**
* im id
*/
@Field("im_user_id")
@Column(name = "im_user_id")
private Integer imUserId;
/**
* 区域id
*/
@Field("area_id")
@Column(name = "area_id")
private Integer areaId;
/**
* 区域名称
*/
@Field("area_name")
@Column(name = "area_name")
private String areaName;
/**
* 问候语句
......@@ -63,16 +76,23 @@ public class CustomerService {
* 客服电话
*/
private String telphone;
/**
* 登录密码
*/
private String password;
/**
* 是事删除 true:删除状态 1:正常
*/
@Field("is_del")
@Column(name = "is_del")
private Boolean isDel;
@Field("create_time")
@Column(name = "create_time")
private Long createTime;
@Field("update_time")
@Column(name = "update_time")
private Long updateTime;
}
......@@ -20,7 +20,7 @@ import java.io.Serializable;
public class CustomerServiceVO implements Serializable {
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;
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.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
......
......@@ -2,6 +2,7 @@ package com.xxfc.platform.im.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.im.biz.CustomerServiceBiz;
import com.xxfc.platform.im.biz.CustomerServiceMGBiz;
import com.xxfc.platform.im.vo.CustomerServiceVO;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -22,16 +23,19 @@ import java.util.List;
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@RequestMapping("/app/unauth/customer_service")
public class CustomerServiceController {
private final CustomerServiceMGBiz customerServiceMGBiz;
private final CustomerServiceBiz customerServiceBiz;
@GetMapping("/list")
public ObjectRestResponse<List<CustomerServiceVO>> findAll(){
// List<CustomerServiceVO> customerServiceVOS = customerServiceMGBiz.findAll();
List<CustomerServiceVO> customerServiceVOS = customerServiceBiz.findAll();
return ObjectRestResponse.succ(customerServiceVOS);
}
@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);
return ObjectRestResponse.succ(customerServiceVO);
}
......
package com.xxfc.platform.im.rest.admin;
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.CustomerServiceMGBiz;
import com.xxfc.platform.im.biz.UserBiz;
import com.xxfc.platform.im.dto.CustomerServiceDTO;
import com.xxfc.platform.im.vo.CustomerServiceVO;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -19,13 +22,28 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping("/admin/customer_service")
public class CustomerServiceAdminController {
private final CustomerServiceMGBiz customerServiceMGBiz;
private final CustomerServiceBiz customerServiceBiz;
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")
public ObjectRestResponse<Void> addCustomerService(@RequestBody CustomerServiceDTO customerServiceDTO){
// customerServiceMGBiz.addCustomerService(customerServiceDTO);
customerServiceBiz.addCustomerService(customerServiceDTO);
return ObjectRestResponse.succ();
}
......@@ -34,12 +52,14 @@ public class CustomerServiceAdminController {
public ObjectRestResponse<Void> updateCustomerService(@PathVariable(value = "telphone") String telphone,
@PathVariable(value = "password") String password){
userBiz.updatePasswordByPhone(telphone,password);
customerServiceBiz.updatePasswordByPhone(telphone,password);
return ObjectRestResponse.succ();
}
@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){
// customerServiceMGBiz.updateCustomerServiceIsDelToTrue(id,imUserId);
customerServiceBiz.updateCustomerServiceIsDelToTrue(id,imUserId);
return ObjectRestResponse.succ();
}
......
......@@ -29,8 +29,8 @@ 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.github.wxiaoqi.security.admin.constant.enumerate.MemberEnum.NONE;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.*;
import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
/**
......@@ -472,7 +472,7 @@ public class OrderMsgBiz {
private void handelSmsParamApp(CompanyDetail startCompanyDetail, CompanyDetail endCompanyDetail, OrderRentVehicleDetail orvd, OrderTourDetail otd, OrderMemberDetail omd, BaseOrder baseOrder, List<String> smsParams, AppUserDTO appUserDTO, int paramHandelType) {
switch (paramHandelType) {
case SmsTemplateDTO.PAY_A :
if(0 < appUserDTO.getMemberLevel() ) {
if(SYS_TRUE.equals(appUserDTO.getIsMember()) && !NONE.getCode().equals(appUserDTO.getMemberLevel()) ) {
smsParams.add(USER_M+ appUserDTO.getRealname());
}else {
smsParams.add(USER_N+ appUserDTO.getRealname());
......@@ -502,14 +502,14 @@ public class OrderMsgBiz {
smsParams.add(appUserDTO.getRentFreeDays().toString());
break;
case SmsTemplateDTO.CANCEL_A :
if(0 < appUserDTO.getMemberLevel() ) {
if(SYS_TRUE.equals(appUserDTO.getIsMember()) && !NONE.getCode().equals(appUserDTO.getMemberLevel()) ) {
smsParams.add(USER_M+ appUserDTO.getRealname());
}else {
smsParams.add(USER_N+ appUserDTO.getRealname());
}
break;
case SmsTemplateDTO.PAY_I :
if(0 < appUserDTO.getMemberLevel() ) {
if(SYS_TRUE.equals(appUserDTO.getIsMember()) && !NONE.getCode().equals(appUserDTO.getMemberLevel()) ) {
smsParams.add(USER_M+ appUserDTO.getRealname());
}else {
smsParams.add(USER_N+ appUserDTO.getRealname());
......@@ -517,7 +517,7 @@ public class OrderMsgBiz {
smsParams.add(startCompanyDetail.getAddrDetail());
break;
case SmsTemplateDTO.PAY_J :
if(0 < appUserDTO.getMemberLevel() ) {
if(SYS_TRUE.equals(appUserDTO.getIsMember()) && !NONE.getCode().equals(appUserDTO.getMemberLevel()) ) {
smsParams.add(USER_M+ appUserDTO.getRealname());
}else {
smsParams.add(USER_N+ appUserDTO.getRealname());
......@@ -534,7 +534,7 @@ public class OrderMsgBiz {
private void handelDepositSmsParamApp(BigDecimal originalAmount, BigDecimal violateAmount, BigDecimal refundAmount, BigDecimal residueAmount,BaseOrder baseOrder, List<String> smsParams, AppUserDTO appUserDTO, int paramHandelType) {
switch (paramHandelType) {
case SmsTemplateDTO.CANCEL_C :
if(0 < appUserDTO.getMemberLevel() ) {
if(SYS_TRUE.equals(appUserDTO.getIsMember()) && !NONE.getCode().equals(appUserDTO.getMemberLevel()) ) {
smsParams.add(USER_M+ appUserDTO.getRealname());
}else {
smsParams.add(USER_N+ appUserDTO.getRealname());
......@@ -549,7 +549,7 @@ public class OrderMsgBiz {
case SmsTemplateDTO.REFUND_A:
Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData();
Integer rentDepositAutoRefundTime = new Integer(dictionaryMap.get(APP_ORDER+ "_"+ DictionaryKey.RENT_DEPOSIT_AUTO_REFUND_TIME).getDetail());
if(0 < appUserDTO.getMemberLevel() ) {
if(SYS_TRUE.equals(appUserDTO.getIsMember()) && !NONE.getCode().equals(appUserDTO.getMemberLevel()) ) {
smsParams.add(USER_M+ appUserDTO.getRealname());
}else {
smsParams.add(USER_N+ appUserDTO.getRealname());
......@@ -562,7 +562,7 @@ public class OrderMsgBiz {
smsParams.add(DateUtil.formatDateTime(DateUtil.date(baseOrder.getRefundTime() + Long.valueOf(rentDepositAutoRefundTime * 60 * 60 * 1000))));
break;
case SmsTemplateDTO.REFUND_B:
if(0 < appUserDTO.getMemberLevel() ) {
if(SYS_TRUE.equals(appUserDTO.getIsMember()) && !NONE.getCode().equals(appUserDTO.getMemberLevel()) ) {
smsParams.add(USER_M+ appUserDTO.getRealname());
}else {
smsParams.add(USER_N+ appUserDTO.getRealname());
......
......@@ -121,6 +121,11 @@ public class BackStageOrderController extends CommonBaseController implements Us
dto.setCompanyIds(companyIds);
}
if (StringUtils.isNotEmpty(dto.getPlateNumber())){
List<String> vehicleIds = vehicleFeign.findbyPlateNumber(dto.getPlateNumber().trim());
dto.setVehicleIds(vehicleIds);
}
Query query = new Query(dto);
PageDataVO pageDataVO = PageDataVO.pageInfo(query, () -> baseOrderBiz.listOrder(query.getSuper()));
List<OrderListVo> list = pageDataVO.getData();
......
......@@ -309,6 +309,13 @@ public class BaseOrderController extends CommonBaseController implements UserRes
private String phone;
private List<String> vehicleIds;
/**
* 车牌号
*/
private String plateNumber;
@ApiModelProperty("当前页码")
Integer page;
@ApiModelProperty("每页限制")
......
......@@ -142,6 +142,11 @@
and (r.start_time between #{startTime} and #{endTime}
or t.start_time between #{startTime} and #{endTime})
</if>
<if test="vehicleIds != null and vehicleIds.size() > 0">
AND r.vehicle_id IN <foreach collection="vehicleIds" item="vehicleId" open="(" close=")" separator=",">
#{vehicleId}
</foreach>
</if>
<if test="companyIds != null and companyIds.size > 0">
and (r.start_company_id in
<foreach collection="companyIds" item="id" open="(" separator="," close=")">
......
......@@ -36,7 +36,16 @@
LEFT JOIN tour_good_site s ON v.site_id=s.id
LEFT JOIN tour_good g ON v.good_id=g.id
LEFT JOIN tour_good_spe_price p ON v.spe_id=p.id
WHERE s.company_id=#{companyId} and v.status=#{orderStatus} and p.start_time=#{travelDate} ORDER BY s.depart_time ) as `goodOrder`
WHERE 1=1
<if test='companyId !=null'>
and s.company_id=#{companyId}
</if>
<if test="orderStatus!=null">
and v.status=#{orderStatus}
</if>
<if test="travelDate!=null">
and p.start_time=#{travelDate}
</if> ORDER BY s.depart_time ) as `goodOrder`
</select>
<!-- 获取旅游路线id-->
<select id="getGoodList" resultType="com.xxfc.platform.tour.vo.TourVerificationInfoVo">
......
......@@ -115,7 +115,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
// if (articleList.size() > HOME_PAGE_NUMBER) {
// return articleList.subList(0, HOME_PAGE_NUMBER);
// } else {
return articleList;
return articleList;
// }
// }
}
......@@ -138,13 +138,12 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
article.setType(0);
}
<<<<<<< HEAD
if (article.getStatus()==1){
article.setAddTime(new Date());
=======
if (article.getTagTitle()==null||article.getKeywords()==null||article.getDescription()==null) {
throw new BaseException("必须设置seo");
>>>>>>> 13151cd28becd80af54c5e67901b2f7c3e67a966
}
if (article.getStatus()==1){
article.setAddTime(new Date());
}
article.setCreTime(new Date());
mapper.insertSelective(article);
......@@ -171,9 +170,9 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
@Override
@Transactional(rollbackFor = Exception.class)
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");
throw new BaseException("必须设置seo");
}
return mapper.updateByPrimaryKeySelective(article);
}
......@@ -189,7 +188,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
article.setUpdTime(new Date());
article.setAddTime(new Date());
article.setStatus(1);
return mapper.updateByPrimaryKeySelective(article);
return mapper.updateByPrimaryKeySelective(article);
}
/**
......
......@@ -16,6 +16,9 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Service
@Slf4j
......@@ -196,12 +199,23 @@ public class SmsService {
JSONObject jsonParams=new JSONObject();
for (int i=0;i<params.length;i++){
String para=params[i];
if (para.contains("【")){
para=para.replaceAll("【","");
}
if (para.contains("】")){
para=para.replaceAll("】","");
if (StringUtils.isNotBlank(para)){
if (para.contains("【")){
para=para.replaceAll("【","");
}
if (para.contains("】")){
para=para.replaceAll("】","");
}
if (para.length()>20){
if (isNumeric(para)){
para.substring(0,20);
}else {
para=para.substring(0,18);
para+="..";
}
}
}
jsonParams.put(param+(i+1),para);
}
sendTemplate(PhoneNumbers,jsonParams.toJSONString(),templateCode);
......@@ -216,12 +230,24 @@ public class SmsService {
JSONObject jsonParams=new JSONObject();
for (int i=0;i<params.length;i++){
String para=params[i];
if (para.contains("【")){
para=para.replaceAll("【","");
}
if (para.contains("】")){
para=para.replaceAll("】","");
if (StringUtils.isNotBlank(para)){
if (para.contains("【")){
para=para.replaceAll("【","");
}
if (para.contains("】")){
para=para.replaceAll("】","");
}
if (para.length()>20){
if (isNumeric(para)){
para.substring(0,20);
}else {
para=para.substring(0,18);
para+="..";
}
}
}
if (i>3){
jsonParams.put(param+(i+2),para);
}else {
......@@ -236,11 +262,26 @@ public class SmsService {
}
/**
* 是否是数字
* @param str
* @return
*/
public static boolean isNumeric(String str){
Pattern pattern = Pattern.compile("[0-9]*");
Matcher isNum = pattern.matcher(str);
if( !isNum.matches() ){
return false;
}
return true;
}
public static void main(String[] args) throws ClientException, InterruptedException {
SmsService smsService=new SmsService();
//发短信
String[] params={"1","2","3","2019-08-29","【松山湖】"};
SmsService.sendTemplateToJson("13612688539,13265487972",params,"SMS_169904346");
SmsService.sendTemplateToJson("13612688539",params,"SMS_169904346");
/*System.out.println("短信接口返回的数据----------------");
System.out.println("Code=" + response.getCode());
System.out.println("Message=" + response.getMessage());
......
......@@ -149,4 +149,7 @@ public interface VehicleFeign {
*/
@GetMapping("/cata/add/getCatasByIds/{ids}")
public ObjectRestResponse<List<VehiclePlatCata>> getCatasByIds(@PathVariable("ids") String ids);
@GetMapping("/vehicleInfo/findwith_plate_number")
List<String> findbyPlateNumber(@RequestParam(value = "plateNumber") String plateNumber);
}
package com.xxfc.platform.vehicle.biz;
import com.ace.cache.annotation.CacheClear;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.RandomUtil;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.RedisKey;
import com.xxfc.platform.vehicle.entity.*;
import com.xxfc.platform.vehicle.mapper.BranchCompanyStockInfoMapper;
import com.xxfc.platform.vehicle.mapper.CompanyBaseMapper;
......@@ -192,6 +194,7 @@ public class CompanyBaseBiz extends BaseBiz<CompanyBaseMapper, CompanyBase> {
return ObjectRestResponse.succ();
}
//设置基础信息
@CacheClear(pre = RedisKey.BRANCH_COMPANY_CACHE)
public ObjectRestResponse updCompany(CompanyVo companyVo){
if (companyVo==null|| StringUtils.isBlank(companyVo.getCompanyName())|| StringUtils.isBlank(companyVo.getName())||
companyVo.getZoneId()==null||companyVo.getZoneId()==0|| companyVo.getAddrProvince()==null||companyVo.getAddrProvince()==0
......
......@@ -1446,4 +1446,16 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
public List<String> findExistVehicleIds() {
return mapper.findExistVehicleIds();
}
public List<String> findVehicleIdsByPlateNumber(String plateNumber) {
List<String> vehicleIds = Lists.newArrayList();
Example example = new Example(Vehicle.class);
Example.Criteria criteria = example.createCriteria();
criteria.andLike("numberPlate",String.format("%%%s%%",plateNumber.trim()));
List<Vehicle> vehicles = mapper.selectByExample(example);
if (CollectionUtils.isEmpty(vehicles)){
return vehicleIds;
}
return vehicles.stream().map(Vehicle::getId).collect(Collectors.toList());
}
}
......@@ -517,4 +517,9 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
public ObjectRestResponse checkBookHourInfo() {
return vehicleBookHourInfoBiz.checkBookHourInfo();
}
@GetMapping("/findwith_plate_number")
List<String> findbyPlateNumber(@RequestParam(value = "plateNumber") String plateNumber){
return vehicleBiz.findVehicleIdsByPlateNumber(plateNumber);
}
}
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