Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
commit
a584596699
@ -1,13 +1,13 @@
|
||||
package cn.com.tenlion.controller.app.apis.cardtemplateuse;
|
||||
|
||||
import cn.com.tenlion.accesstokenmanager.AccessTokenManager;
|
||||
import cn.com.tenlion.controller.AbstractController;
|
||||
import cn.com.tenlion.pojo.dtos.cardtemplateuse.CardTemplateUseDTO;
|
||||
import cn.com.tenlion.pojo.dtos.carduser.CardUserDTO;
|
||||
import cn.com.tenlion.pojo.vos.cardtemplateuse.CardTemplateUseVO;
|
||||
import cn.com.tenlion.service.cardtemplateuse.ICardTemplateUseService;
|
||||
import cn.com.tenlion.util.annotation.AccessRightsCheck;
|
||||
import cn.com.tenlion.util.check.CheckRequestBodyAnnotation;
|
||||
import cn.com.tenlion.util.cons.ISystemConstant;
|
||||
import cn.com.tenlion.util.enumeration.Auth;
|
||||
import cn.com.tenlion.util.exception.RemoveException;
|
||||
import cn.com.tenlion.util.exception.SearchException;
|
||||
import cn.com.tenlion.util.page.ListPage;
|
||||
@ -44,21 +44,20 @@ public class CardTemplateUseAppController extends AbstractController {
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("savecardtemplateuse")
|
||||
@CheckRequestBodyAnnotation
|
||||
@AccessRightsCheck(auth= Auth.NOCHECK,authUrl="",operation="新增模板使用")
|
||||
public SuccessResult saveCardTemplateUse(/*@RequestHeader("token") String token, */@RequestBody CardTemplateUseVO cardTemplateUseVO) throws Exception {
|
||||
//CardUserDTO tokenManage = AccessTokenManager.getInstance().getKey(token);
|
||||
return cardTemplateUseService.saveCardTemplateUseByToken("123456", cardTemplateUseVO);
|
||||
public SuccessResult saveCardTemplateUse(@RequestHeader("token") String token, @RequestBody CardTemplateUseVO cardTemplateUseVO) throws Exception {
|
||||
CardUserDTO tokenManage = AccessTokenManager.getInstance().getKey(token);
|
||||
return cardTemplateUseService.saveCardTemplateUseByToken(tokenManage.getCardUserId(), cardTemplateUseVO);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除模板使用(id列表)", notes = "删除模板使用(id列表)接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
//@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@DeleteMapping("removecardtemplateuse/{ids}")
|
||||
public SuccessResult removeCardTemplateUse(@RequestHeader("token") String token, @PathVariable("ids") String ids) throws RemoveException {
|
||||
return cardTemplateUseService.removeCardTemplateUseByToken(token, ids);
|
||||
return cardTemplateUseService.removeCardTemplateUseByToken("", ids);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改模板使用", notes = "修改模板使用接口")
|
||||
@ -70,7 +69,7 @@ public class CardTemplateUseAppController extends AbstractController {
|
||||
@PutMapping("updatecardtemplateuse/{cardTemplateUseId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult updateCardTemplateUse(@RequestHeader("token") String token, @PathVariable("cardTemplateUseId") String cardTemplateUseId, @RequestBody CardTemplateUseVO cardTemplateUseVO) throws Exception {
|
||||
return cardTemplateUseService.updateCardTemplateUseByToken(token, cardTemplateUseId, cardTemplateUseVO);
|
||||
return cardTemplateUseService.updateCardTemplateUseByToken("", cardTemplateUseId, cardTemplateUseVO);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "模板使用详情(通过ID)", notes = "模板使用详情(通过ID)接口")
|
||||
@ -92,6 +91,11 @@ public class CardTemplateUseAppController extends AbstractController {
|
||||
@GetMapping("listcardtemplateuse")
|
||||
public List<CardTemplateUseDTO> listCardTemplateUse(@RequestHeader("token") String token) throws SearchException {
|
||||
Map<String, Object> params = requestParams();
|
||||
/**
|
||||
* 显示登陆人使用的模板
|
||||
*/
|
||||
CardUserDTO tokenManage = AccessTokenManager.getInstance().getKey(token);
|
||||
params.put("creator", tokenManage.getCardUserId());
|
||||
return cardTemplateUseService.listCardTemplateUse(params);
|
||||
}
|
||||
|
||||
@ -108,6 +112,11 @@ public class CardTemplateUseAppController extends AbstractController {
|
||||
@GetMapping("listpagecardtemplateuse")
|
||||
public SuccessResultList<List<CardTemplateUseDTO>> listPageCardTemplateUse(@RequestHeader("token") String token, ListPage page) throws SearchException {
|
||||
Map<String, Object> params = requestParams();
|
||||
/**
|
||||
* 显示登陆人使用的模板
|
||||
*/
|
||||
CardUserDTO tokenManage = AccessTokenManager.getInstance().getKey(token);
|
||||
params.put("creator", tokenManage.getCardUserId());
|
||||
page.setParams(params);
|
||||
return cardTemplateUseService.listPageCardTemplateUse(page);
|
||||
}
|
||||
|
@ -81,11 +81,12 @@ public class CardTemplateUseAreaAppController extends AbstractController {
|
||||
|
||||
@ApiOperation(value = "模板使用区域数据列表", notes = "模板使用区域数据列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header")
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "templateUseId", value = "使用模板ID", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listcardtemplateusearea")
|
||||
public List<CardTemplateUseAreaDTO> listCardTemplateUseArea(@RequestHeader("token") String token) throws SearchException {
|
||||
@GetMapping("listcardtemplateusearea/{templateUseId}")
|
||||
public List<CardTemplateUseAreaDTO> listCardTemplateUseArea(@RequestHeader("token") String token, @PathVariable("templateUseId") String templateUseId) throws SearchException {
|
||||
Map<String, Object> params = requestParams();
|
||||
return cardTemplateUseAreaService.listCardTemplateUseArea(params);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.com.tenlion.pojo.dtos.cardtemplateusearea;
|
||||
|
||||
import cn.com.tenlion.pojo.dtos.cardtemplatearea.CardTemplateAreaDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@ -32,6 +33,16 @@ public class CardTemplateUseAreaDTO {
|
||||
private String templateAreaFontSize;
|
||||
@ApiModelProperty(name = "templateAreaFontSizeDictionaryName", value = "区域字体大小/预留功能(数据字典)字典名称")
|
||||
private String templateAreaFontSizeDictionaryName;
|
||||
@ApiModelProperty(name = "cardTemplateAreaDTO", value = "区域原始数据对象")
|
||||
private CardTemplateAreaDTO cardTemplateAreaDTO;
|
||||
|
||||
public CardTemplateAreaDTO getCardTemplateAreaDTO() {
|
||||
return cardTemplateAreaDTO;
|
||||
}
|
||||
|
||||
public void setCardTemplateAreaDTO(CardTemplateAreaDTO cardTemplateAreaDTO) {
|
||||
this.cardTemplateAreaDTO = cardTemplateAreaDTO;
|
||||
}
|
||||
|
||||
public String getCardTemplateUseAreaId() {
|
||||
return cardTemplateUseAreaId == null ? "" : cardTemplateUseAreaId.trim();
|
||||
|
@ -1,10 +1,14 @@
|
||||
package cn.com.tenlion.pojo.vos.cardtemplateuse;
|
||||
|
||||
import cn.com.tenlion.pojo.vos.cardtemplateusearea.CardTemplateUseAreaVO;
|
||||
import cn.com.tenlion.util.check.CheckEmptyAnnotation;
|
||||
import cn.com.tenlion.util.check.CheckNumberAnnotation;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @ClassName: CardTemplateUseVO
|
||||
@ -46,6 +50,19 @@ public class CardTemplateUseVO {
|
||||
private String templateUseCity;
|
||||
@ApiModelProperty(name = "templateUseUrl", value = "名片预览网络地址(全路径)")
|
||||
private String templateUseUrl;
|
||||
@ApiModelProperty(name = "templateUseUrl", value = "区域数据")
|
||||
private List<CardTemplateUseAreaVO> useAreaVOList = new ArrayList<CardTemplateUseAreaVO>();
|
||||
|
||||
public List<CardTemplateUseAreaVO> getUseAreaVOList() {
|
||||
if (useAreaVOList == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return useAreaVOList;
|
||||
}
|
||||
|
||||
public void setUseAreaVOList(List<CardTemplateUseAreaVO> useAreaVOList) {
|
||||
this.useAreaVOList = useAreaVOList;
|
||||
}
|
||||
|
||||
public String getTemplateId() {
|
||||
return templateId == null ? "" : templateId.trim();
|
||||
|
@ -4,9 +4,11 @@ import cn.com.tenlion.dao.cardtemplateuse.ICardTemplateUseDao;
|
||||
import cn.com.tenlion.pojo.dtos.cardtemplate.CardTemplateDTO;
|
||||
import cn.com.tenlion.pojo.dtos.cardtemplateuse.CardTemplateUseDTO;
|
||||
import cn.com.tenlion.pojo.vos.cardtemplateuse.CardTemplateUseVO;
|
||||
import cn.com.tenlion.pojo.vos.cardtemplateusearea.CardTemplateUseAreaVO;
|
||||
import cn.com.tenlion.service.AbstractService;
|
||||
import cn.com.tenlion.service.cardtemplate.ICardTemplateService;
|
||||
import cn.com.tenlion.service.cardtemplateuse.ICardTemplateUseService;
|
||||
import cn.com.tenlion.service.cardtemplateusearea.ICardTemplateUseAreaService;
|
||||
import cn.com.tenlion.util.base.HashMapUtil;
|
||||
import cn.com.tenlion.util.base.QRCodeUtil;
|
||||
import cn.com.tenlion.util.base.UUIDUtil;
|
||||
@ -40,6 +42,8 @@ public class CardTemplateUseServiceImpl extends AbstractService implements ICard
|
||||
private ICardTemplateUseDao cardTemplateUseDao;
|
||||
@Autowired
|
||||
private ICardTemplateService cardTemplateService;
|
||||
@Autowired
|
||||
private ICardTemplateUseAreaService cardTemplateUseAreaService;
|
||||
|
||||
@Override
|
||||
public SuccessResultData<String> saveCardTemplateUseByToken(String userId, CardTemplateUseVO cardTemplateUseVO) throws Exception {
|
||||
@ -55,6 +59,15 @@ public class CardTemplateUseServiceImpl extends AbstractService implements ICard
|
||||
if(templateDto == null) {
|
||||
throw new SaveException("该模板不存在");
|
||||
}
|
||||
/**
|
||||
* 保存区域数据
|
||||
*/
|
||||
List<CardTemplateUseAreaVO> useAreaVOList = cardTemplateUseVO.getUseAreaVOList();
|
||||
for (CardTemplateUseAreaVO vo : useAreaVOList) {
|
||||
vo.setTemplateUseId(cardTemplateUseId);// 使用模板ID
|
||||
vo.setTemplateId(cardTemplateUseVO.getTemplateId());// 模板ID
|
||||
cardTemplateUseAreaService.saveCardTemplateUseAreaByToken(userId, vo);
|
||||
}
|
||||
/**
|
||||
* 创建名片|海报二维码 , 给二维码是可以扫描后直接进入小程序的名片页面 .
|
||||
* 小程序路径 + 名片ID参数. 小程序页面渲染的时候 , 拿着ID查询判断 是否公开,是否需要密码,是否是该允许区域的用户
|
||||
|
@ -1,9 +1,11 @@
|
||||
package cn.com.tenlion.service.cardtemplateusearea.impl;
|
||||
|
||||
import cn.com.tenlion.dao.cardtemplateusearea.ICardTemplateUseAreaDao;
|
||||
import cn.com.tenlion.pojo.dtos.cardtemplatearea.CardTemplateAreaDTO;
|
||||
import cn.com.tenlion.pojo.dtos.cardtemplateusearea.CardTemplateUseAreaDTO;
|
||||
import cn.com.tenlion.pojo.vos.cardtemplateusearea.CardTemplateUseAreaVO;
|
||||
import cn.com.tenlion.service.AbstractService;
|
||||
import cn.com.tenlion.service.cardtemplatearea.ICardTemplateAreaService;
|
||||
import cn.com.tenlion.service.cardtemplateusearea.ICardTemplateUseAreaService;
|
||||
import cn.com.tenlion.util.base.HashMapUtil;
|
||||
import cn.com.tenlion.util.base.UUIDUtil;
|
||||
@ -17,6 +19,7 @@ import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -33,6 +36,8 @@ public class CardTemplateUseAreaServiceImpl extends AbstractService implements I
|
||||
|
||||
@Autowired
|
||||
private ICardTemplateUseAreaDao cardTemplateUseAreaDao;
|
||||
@Autowired
|
||||
private ICardTemplateAreaService iCardTemplateAreaService;
|
||||
|
||||
@Override
|
||||
public SuccessResultData<String> saveCardTemplateUseAreaByToken(String userId, CardTemplateUseAreaVO cardTemplateUseAreaVO) throws Exception {
|
||||
@ -66,12 +71,21 @@ public class CardTemplateUseAreaServiceImpl extends AbstractService implements I
|
||||
public CardTemplateUseAreaDTO getCardTemplateUseAreaById(String cardTemplateUseAreaId) throws SearchException {
|
||||
Map<String, Object> params = super.getHashMap(1);
|
||||
params.put("cardTemplateUseAreaId", cardTemplateUseAreaId);
|
||||
return cardTemplateUseAreaDao.getCardTemplateUseArea(params);
|
||||
CardTemplateUseAreaDTO useAreaDTO = cardTemplateUseAreaDao.getCardTemplateUseArea(params);
|
||||
Map<String, Object> queryParams = super.getHashMap(1);
|
||||
CardTemplateAreaDTO areaDTO = iCardTemplateAreaService.getCardTemplateAreaById(useAreaDTO.getTemplateAreaId());
|
||||
useAreaDTO.setCardTemplateAreaDTO(areaDTO);
|
||||
return useAreaDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CardTemplateUseAreaDTO> listCardTemplateUseArea(Map<String, Object> params) throws SearchException {
|
||||
return cardTemplateUseAreaDao.listCardTemplateUseArea(params);
|
||||
List<CardTemplateUseAreaDTO> useAreaDTOList = cardTemplateUseAreaDao.listCardTemplateUseArea(params);
|
||||
for(CardTemplateUseAreaDTO useAreaDTO : useAreaDTOList) {
|
||||
CardTemplateAreaDTO areaDTO = iCardTemplateAreaService.getCardTemplateAreaById(useAreaDTO.getTemplateAreaId());
|
||||
useAreaDTO.setCardTemplateAreaDTO(areaDTO);
|
||||
}
|
||||
return useAreaDTOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -195,7 +195,7 @@
|
||||
AND
|
||||
dt2.is_delete = 0
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
t1.is_delete = 0 AND t1.creator = #{creator}
|
||||
<if test="keywords != null and keywords != ''">
|
||||
AND (
|
||||
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||||
@ -219,6 +219,7 @@
|
||||
#{cardTemplateUseIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY t1.gmt_create
|
||||
</select>
|
||||
|
||||
<!-- 模板使用统计 -->
|
||||
|
@ -164,6 +164,9 @@
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||||
</if>
|
||||
<if test="templateUseId != null and templateUseId != ''">
|
||||
AND t1.template_use_id = #{templateUseId}
|
||||
</if>
|
||||
<if test="cardTemplateUseAreaIds != null and cardTemplateUseAreaIds.size > 0">
|
||||
AND
|
||||
t1.card_template_use_area_id IN
|
||||
@ -171,6 +174,7 @@
|
||||
#{cardTemplateUseAreaIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY t1.gmt_create
|
||||
</select>
|
||||
|
||||
<!-- 模板使用区域数据统计 -->
|
||||
|
Loading…
Reference in New Issue
Block a user