Commit 2415666d authored by jiaorz's avatar jiaorz

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

parents 63a5103a b26aaf7b
...@@ -21,10 +21,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -21,10 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example; import tk.mybatis.mapper.entity.Example;
import java.time.Instant; import java.time.Instant;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -78,6 +75,7 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper, ...@@ -78,6 +75,7 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper,
.status(phoneAndUserIdMap == null ? 0 : (phoneAndUserIdMap.get(userMemberSaveDTO.getPhone()) == null ? 0 : 1)) .status(phoneAndUserIdMap == null ? 0 : (phoneAndUserIdMap.get(userMemberSaveDTO.getPhone()) == null ? 0 : 1))
.crtId(userId) .crtId(userId)
.crtName(name) .crtName(name)
.crtTime(Instant.now().toEpochMilli())
.isDel(0) .isDel(0)
.build(); .build();
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
...@@ -188,6 +186,7 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper, ...@@ -188,6 +186,7 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper,
BeanUtils.copyProperties(userMemberExportDTO,baseUserMemberExportVo); BeanUtils.copyProperties(userMemberExportDTO,baseUserMemberExportVo);
baseUserMemberExportVos.add(baseUserMemberExportVo); baseUserMemberExportVos.add(baseUserMemberExportVo);
} }
baseUserMemberExportVos.sort(Comparator.comparing(BaseUserMemberExportVo::getCrtTime).reversed());
baseUserMemberExportVoPageDataVO.setData(baseUserMemberExportVos); baseUserMemberExportVoPageDataVO.setData(baseUserMemberExportVos);
baseUserMemberExportVoPageDataVO.setPageNum(baseUserMemberExportDataDTOS.getPageNum()); baseUserMemberExportVoPageDataVO.setPageNum(baseUserMemberExportDataDTOS.getPageNum());
baseUserMemberExportVoPageDataVO.setPageSize(baseUserMemberExportDataDTOS.getPageSize()); baseUserMemberExportVoPageDataVO.setPageSize(baseUserMemberExportDataDTOS.getPageSize());
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</if> </if>
<if test="endTime != null and startTime == null"> <if test="endTime != null and startTime == null">
and <![CDATA[ `crt_time` <= #{startTime}]]> and <![CDATA[ `crt_time` <= #{startTime}]]>
</if> </if> order by `crt_time` DESC
</select> </select>
<update id="updateUserMemberExportDataStatusById"> <update id="updateUserMemberExportDataStatusById">
......
package com.xxfc.platform.activity.dto;
import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.Data;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/23 10:41
*/
@Data
public class CouponFindDTO extends PageParam {
private String title;
private Integer type;
}
...@@ -96,6 +96,20 @@ public class ActivityList implements Serializable { ...@@ -96,6 +96,20 @@ public class ActivityList implements Serializable {
@Column(name = "picture") @Column(name = "picture")
@ApiModelProperty(value = "活动图片") @ApiModelProperty(value = "活动图片")
private Integer picture; private Integer picture;
/**
* 活动类型
*/
@Column(name = "type")
@ApiModelProperty(value = "活动类型")
private Integer type;
/**
* 活动页面链接
*/
@Column(name = "url")
@ApiModelProperty(value = "活动页面链接")
private Integer url;
} }
...@@ -76,4 +76,18 @@ public class ActivityManagement { ...@@ -76,4 +76,18 @@ public class ActivityManagement {
@Column(name = "picture") @Column(name = "picture")
@ApiModelProperty(value = "活动图片") @ApiModelProperty(value = "活动图片")
private Integer picture; private Integer picture;
/**
* 活动类型
*/
@Column(name = "type")
@ApiModelProperty(value = "活动类型")
private Integer type;
/**
* 活动页面链接
*/
@Column(name = "url")
@ApiModelProperty(value = "活动页面链接")
private Integer url;
} }
package com.xxfc.platform.activity.vo;
import lombok.Data;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/23 10:55
*/
@Data
public class CouponPagVo {
}
...@@ -33,18 +33,17 @@ public class ActivityManagementBiz extends BaseBiz<ActivityManagementMapper, Act ...@@ -33,18 +33,17 @@ public class ActivityManagementBiz extends BaseBiz<ActivityManagementMapper, Act
* @throws InvocationTargetException * @throws InvocationTargetException
* @throws IllegalAccessException * @throws IllegalAccessException
*/ */
public List<ActivityManagement> selectedActivityManagement() throws InvocationTargetException, IllegalAccessException { public List<ActivityList> selectedActivityManagement() throws InvocationTargetException, IllegalAccessException {
long currentTime = System.currentTimeMillis();
Example exa=Example.builder(ActivityList.class).where(WeekendSqls.<ActivityList>custom()
.andGreaterThanOrEqualTo(ActivityList::getEndTime,currentTime)
.andLessThanOrEqualTo(ActivityList::getStartTime,currentTime)
).orderByAsc("sort").build();
activityListBiz.selectByExample(exa);
List<ActivityList> activityLists = activityListBiz.selectListAll(); List<ActivityList> activityLists = activityListBiz.selectListAll();
if (activityLists==null||activityLists.size()==0) {
return null;
} return activityLists;
ArrayList<ActivityManagement> activityManagements = new ArrayList<>();
for (ActivityList activityList : activityLists) {
ActivityManagement activityManagement =getActivityManagement(activityList);
activityManagements.add(activityManagement);
}
return activityManagements;
} }
/** /**
......
...@@ -3,6 +3,7 @@ package com.xxfc.platform.activity.rest; ...@@ -3,6 +3,7 @@ package com.xxfc.platform.activity.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.activity.biz.ActivityManagementBiz; import com.xxfc.platform.activity.biz.ActivityManagementBiz;
import com.xxfc.platform.activity.entity.ActivityList;
import com.xxfc.platform.activity.entity.ActivityManagement; import com.xxfc.platform.activity.entity.ActivityManagement;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -26,10 +27,21 @@ public class ActivityManagementController extends BaseController<ActivityManagem ...@@ -26,10 +27,21 @@ public class ActivityManagementController extends BaseController<ActivityManagem
@RequestMapping("/activity/findAll") @RequestMapping("/activity/findAll")
public ObjectRestResponse<List<ActivityManagement>> findAll() throws InvocationTargetException, IllegalAccessException { public ObjectRestResponse<List<ActivityManagement>> findAll() throws InvocationTargetException, IllegalAccessException {
List<ActivityManagement> list= baseBiz.selectedActivityManagement(); List<ActivityList> list= baseBiz.selectedActivityManagement();
return ObjectRestResponse.succ(list); return ObjectRestResponse.succ(list);
} }
/**
* 精彩活动列表
* @return
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
@RequestMapping("/app/unauth/activity/findAll")
public ObjectRestResponse<List<ActivityManagement>> appFindAll() throws InvocationTargetException, IllegalAccessException {
List<ActivityList> list= baseBiz.selectedActivityManagement();
return ObjectRestResponse.succ(list);
}
/** /**
* 查找一条 * 查找一条
......
package com.xxfc.platform.activity.rest.admin;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.activity.biz.CouponBiz;
import com.xxfc.platform.activity.dto.CouponFindDTO;
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.RestController;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/23 10:39
*/
@RestController
@RequestMapping("/admin/coupon")
public class CouponAdminController {
@Autowired
private CouponBiz couponBiz;
@GetMapping("/page")
public ObjectRestResponse listCouponWithPage(CouponFindDTO couponFindDTO){
return ObjectRestResponse.succ();
}
}
...@@ -6,6 +6,7 @@ import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken; ...@@ -6,6 +6,7 @@ import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.constant.RestCode; import com.github.wxiaoqi.security.common.constant.RestCode;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.util.process.SystemConfig;
import com.xxfc.platform.app.vo.appVersionQuery; import com.xxfc.platform.app.vo.appVersionQuery;
import com.xxfc.platform.vehicle.common.RestResponse; import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.RedisKey; import com.xxfc.platform.vehicle.constant.RedisKey;
...@@ -52,6 +53,8 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> { ...@@ -52,6 +53,8 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
@Value("${app.uploadPath}") @Value("${app.uploadPath}")
private String uploadPath; private String uploadPath;
@Value("${upload.server}")
private String Dev_url;
@Autowired @Autowired
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
...@@ -99,16 +102,17 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> { ...@@ -99,16 +102,17 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
public ObjectRestResponse uploadDrivingLicense(MultipartFile file) throws IOException { public ObjectRestResponse uploadDrivingLicense(MultipartFile file) throws IOException {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
String dirPathToday = File.separator + now.toString(DEFAULT_DATE_TIME_FORMATTER); String dirPathToday = "/" + now.toString(DEFAULT_DATE_TIME_FORMATTER);
// String redisNoKey = RedisKey.UPLOAD_FILE_NO_PREFIX + now.toString(DEFAULT_DATE_TIME_FORMATTER); // String redisNoKey = RedisKey.UPLOAD_FILE_NO_PREFIX + now.toString(DEFAULT_DATE_TIME_FORMATTER);
// Long no = redisTemplate.opsForValue().increment(redisNoKey); // Long no = redisTemplate.opsForValue().increment(redisNoKey);
// if(no.equals(1L)){ // if(no.equals(1L)){
// redisTemplate.expire(redisNoKey,1, TimeUnit.DAYS); // redisTemplate.expire(redisNoKey,1, TimeUnit.DAYS);
// } // }
String fileName = file.getOriginalFilename(); String fileName = file.getOriginalFilename();
String realFileRelPath = dirPathToday + File.separator+fileName; String realFileRelPath = dirPathToday + "/"+fileName;
String filePath = uploadPath + realFileRelPath; String filePath = uploadPath + realFileRelPath;
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath)); FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath));
realFileRelPath=Dev_url+realFileRelPath;
return ObjectRestResponse.succ(filePath); return ObjectRestResponse.succ(filePath);
} }
......
...@@ -5,6 +5,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; ...@@ -5,6 +5,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
...@@ -17,5 +18,6 @@ public class BaseController<Biz extends BaseBiz> { ...@@ -17,5 +18,6 @@ public class BaseController<Biz extends BaseBiz> {
@Autowired @Autowired
protected HttpServletRequest request; protected HttpServletRequest request;
@Autowired @Autowired
@Lazy
protected Biz baseBiz; protected Biz baseBiz;
} }
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