Commit a80b4575 by 18356073052

新客自动拉群列表查询参数修改

1 parent aa472ef4
......@@ -46,25 +46,28 @@ import java.util.zip.ZipOutputStream;
@RequestMapping(value = "communityNewGroup")
public class WeCommunityNewGroupController extends BaseController {
@Autowired
private IWeCommunityNewGroupService weCommunityNewGroupService;
@Autowired
private IWeCommunityNewGroupService weCommunityNewGroupService;
/**
* 查询新客自动拉群列表
*/
@ApiOperation(value = "查询新客自动拉群列表",httpMethod = "GET")
@ApiOperation(value = "查询新客自动拉群列表", httpMethod = "GET")
@PreAuthorize("@ss.hasPermi('wecom:communityNewGroup:list')")
@GetMapping("/list")
public TableDataInfo list(WeCommunityNewGroup communityNewGroup) {
public TableDataInfo list(@RequestParam(value = "empleCodeName", required = false) String empleCodeName
, @RequestParam(value = "createBy", required = false) String createBy
, @RequestParam(value = "beginTime", required = false) String beginTime
, @RequestParam(value = "endTime", required = false) String endTime) {
startPage();
List<WeCommunityNewGroupVo> communityNewGroupVos = weCommunityNewGroupService.selectWeCommunityNewGroupList(communityNewGroup);
List<WeCommunityNewGroupVo> communityNewGroupVos = weCommunityNewGroupService.selectWeCommunityNewGroupList(empleCodeName, createBy, beginTime, endTime);
return getDataTable(communityNewGroupVos);
}
/**
* 获取新客自动拉群详细信息
*/
@ApiOperation(value = "获取新客自动拉群详细信息",httpMethod = "GET")
@ApiOperation(value = "获取新客自动拉群详细信息", httpMethod = "GET")
@PreAuthorize("@ss.hasPermi('wecom:communityNewGroup:query')")
@GetMapping(value = "/{id}")
public AjaxResult<WeCommunityNewGroupVo> getInfo(@PathVariable("newGroupId") @ApiParam("主键ID") Long newGroupId) {
......@@ -74,7 +77,7 @@ public class WeCommunityNewGroupController extends BaseController {
/**
* 修改新客自动拉群
*/
@ApiOperation(value = "修改新客自动拉群",httpMethod = "PUT")
@ApiOperation(value = "修改新客自动拉群", httpMethod = "PUT")
@PreAuthorize("@ss.hasPermi('wecom:communityNewGroup:edit')")
@Log(title = "新客自动拉群", businessType = BusinessType.UPDATE)
@PutMapping("/update")
......@@ -87,7 +90,7 @@ public class WeCommunityNewGroupController extends BaseController {
/**
* 删除新客自动拉群
*/
@ApiOperation(value = "删除新客自动拉群",httpMethod = "DELETE")
@ApiOperation(value = "删除新客自动拉群", httpMethod = "DELETE")
@PreAuthorize("@ss.hasPermi('wecom:communityNewGroup:remove')")
@Log(title = "新客自动拉群", businessType = BusinessType.DELETE)
@DeleteMapping("/delete/{ids}")
......@@ -100,7 +103,7 @@ public class WeCommunityNewGroupController extends BaseController {
/**
* 新增新客自动拉群
*/
@ApiOperation(value = "新增新客自动拉群",httpMethod = "POST")
@ApiOperation(value = "新增新客自动拉群", httpMethod = "POST")
@PreAuthorize("@ss.hasPermi('wecom:communityNewGroup:add')")
@Log(title = "新客自动拉群", businessType = BusinessType.INSERT)
@PostMapping("/add")
......@@ -110,9 +113,9 @@ public class WeCommunityNewGroupController extends BaseController {
return AjaxResult.success();
} catch (Exception e) {
e.printStackTrace();
if (e instanceof WeComException){
if (e instanceof WeComException) {
return AjaxResult.error(e.getMessage());
}else {
} else {
return AjaxResult.error("请求接口异常!");
}
}
......@@ -123,16 +126,16 @@ public class WeCommunityNewGroupController extends BaseController {
/**
* 员工活码批量下载
*
* @param ids 新客自动拉群ids
* @param request 请求
* @param ids 新客自动拉群ids
* @param request 请求
* @param response 输出
* @throws Exception
*/
@ApiOperation(value = "员工活码批量下载",httpMethod = "GET")
@ApiOperation(value = "员工活码批量下载", httpMethod = "GET")
@PreAuthorize("@ss.hasPermi('wecom:code:downloadBatch')")
@Log(title = "员工活码批量下载", businessType = BusinessType.OTHER)
@GetMapping("/downloadBatch")
public void downloadBatch(String ids, HttpServletRequest request, HttpServletResponse response){
public void downloadBatch(String ids, HttpServletRequest request, HttpServletResponse response) {
List<String> idList = Arrays.stream(Optional.ofNullable(ids).orElse("").split(","))
.filter(StringUtils::isNotEmpty).collect(Collectors.toList());
try {
......@@ -141,15 +144,15 @@ public class WeCommunityNewGroupController extends BaseController {
//zip输出流
ZipOutputStream zos = new ZipOutputStream(response.getOutputStream());
if (CollectionUtil.isNotEmpty(weCommunityNewGroupVos)){
for (WeCommunityNewGroupVo communityNewGroupVo : weCommunityNewGroupVos){
if (CollectionUtil.isNotEmpty(weCommunityNewGroupVos)) {
for (WeCommunityNewGroupVo communityNewGroupVo : weCommunityNewGroupVos) {
String qrCode = communityNewGroupVo.getQrCode();
if (StringUtils.isEmpty(qrCode)){
if (StringUtils.isEmpty(qrCode)) {
continue;
}
URL url = new URL(qrCode);
//每个二维码名称
String fileName =communityNewGroupVo.getEmpleCodeName()+communityNewGroupVo.getActivityScene()+".jpg";
String fileName = communityNewGroupVo.getEmpleCodeName() + communityNewGroupVo.getActivityScene() + ".jpg";
zos.putNextEntry(new ZipEntry(fileName));
InputStream fis = url.openConnection().getInputStream();
byte[] buffer = new byte[1024];
......@@ -165,20 +168,20 @@ public class WeCommunityNewGroupController extends BaseController {
zos.close();
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
}
@ApiOperation(value = "员工活码下载",httpMethod = "GET")
@ApiOperation(value = "员工活码下载", httpMethod = "GET")
@PreAuthorize("@ss.hasPermi('wecom:code:download')")
@Log(title = "员工活码下载", businessType = BusinessType.OTHER)
@GetMapping("/download")
public void download(String id, HttpServletRequest request, HttpServletResponse response){
WeCommunityNewGroupVo communityNewGroupVo=weCommunityNewGroupService.selectWeCommunityNewGroupById(Long.valueOf(id));
if (StringUtils.isEmpty(communityNewGroupVo.getQrCode())){
public void download(String id, HttpServletRequest request, HttpServletResponse response) {
WeCommunityNewGroupVo communityNewGroupVo = weCommunityNewGroupService.selectWeCommunityNewGroupById(Long.valueOf(id));
if (StringUtils.isEmpty(communityNewGroupVo.getQrCode())) {
return;
}else {
} else {
try {
FileUtils.downloadFile(communityNewGroupVo.getQrCode(), response.getOutputStream());
} catch (IOException e) {
......
......@@ -21,7 +21,8 @@ public interface WeCommunityNewGroupMapper extends BaseMapper<WeCommunityNewGrou
* @param communityNewGroup 搜索信息
* @return {@link WeCommunityNewGroup}s
*/
List<WeCommunityNewGroupVo> selectWeCommunityNewGroupList(WeCommunityNewGroup communityNewGroup);
List<WeCommunityNewGroupVo> selectWeCommunityNewGroupList(@Param("empleCodeName") String empleCodeName, @Param("createBy") String createBy
,@Param("beginTime") String beginTime, @Param("endTime") String endTime);
/**
* 获取新客自动拉群详细信息
......
......@@ -26,10 +26,9 @@ public interface IWeCommunityNewGroupService extends IService<WeCommunityNewGrou
/**
* 查询新客自动拉群列表
*
* @param communityNewGroup 搜索信息
* @return {@link WeCommunityNewGroup}s
*/
List<WeCommunityNewGroupVo> selectWeCommunityNewGroupList(WeCommunityNewGroup communityNewGroup);
List<WeCommunityNewGroupVo> selectWeCommunityNewGroupList(String empleCodeName, String createBy, String beginTime, String endTime);
/**
* 获取新客自动拉群详细信息
......
......@@ -115,8 +115,8 @@ public class WeCommunityNewGroupServiceImpl extends ServiceImpl<WeCommunityNewGr
}
@Override
public List<WeCommunityNewGroupVo> selectWeCommunityNewGroupList(WeCommunityNewGroup communityNewGroup) {
List<WeCommunityNewGroupVo> weCommunityNewGroupVos = weCommunityNewGroupMapper.selectWeCommunityNewGroupList(communityNewGroup);
public List<WeCommunityNewGroupVo> selectWeCommunityNewGroupList(String empleCodeName, String createBy, String beginTime, String endTime) {
List<WeCommunityNewGroupVo> weCommunityNewGroupVos = weCommunityNewGroupMapper.selectWeCommunityNewGroupList(empleCodeName, createBy, beginTime, endTime);
if (CollectionUtil.isNotEmpty(weCommunityNewGroupVos)) {
List<Long> newGroupIdList = weCommunityNewGroupVos.stream().map(WeCommunityNewGroupVo::getNewGroupId).collect(Collectors.toList());
List<WeEmpleCodeUseScop> useScopList = iWeEmpleCodeUseScopService.selectWeEmpleCodeUseScopListByIds(newGroupIdList);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!