diff --git a/src/main/java/cn/com/tenlion/controller/app/apis/templateperson/TemplatePersonAppController.java b/src/main/java/cn/com/tenlion/controller/app/apis/templateperson/TemplatePersonAppController.java index 2a1609d..c163d9c 100644 --- a/src/main/java/cn/com/tenlion/controller/app/apis/templateperson/TemplatePersonAppController.java +++ b/src/main/java/cn/com/tenlion/controller/app/apis/templateperson/TemplatePersonAppController.java @@ -90,6 +90,7 @@ public class TemplatePersonAppController extends DefaultBaseController { @GetMapping("list") public List list(@RequestHeader("token") String token) { Map params = requestParams(); + params.put("token", token); return templatePersonService.list(params); } diff --git a/src/main/java/cn/com/tenlion/pojo/bos/templateperson/TemplatePersonBO.java b/src/main/java/cn/com/tenlion/pojo/bos/templateperson/TemplatePersonBO.java index cf5f3d5..d6ca516 100644 --- a/src/main/java/cn/com/tenlion/pojo/bos/templateperson/TemplatePersonBO.java +++ b/src/main/java/cn/com/tenlion/pojo/bos/templateperson/TemplatePersonBO.java @@ -19,6 +19,8 @@ public class TemplatePersonBO { private Integer cardOrder; private String thumbnail; private Integer isMain; + private String cardWidth; + private String cardHeight; public String getCardPersonId() { return cardPersonId == null ? "" : cardPersonId.trim(); @@ -91,4 +93,20 @@ public class TemplatePersonBO { public void setIsMain(Integer isMain) { this.isMain = isMain; } + + public String getCardWidth() { + return cardWidth == null ? "" : cardWidth; + } + + public void setCardWidth(String cardWidth) { + this.cardWidth = cardWidth; + } + + public String getCardHeight() { + return cardHeight == null ? "" : cardHeight; + } + + public void setCardHeight(String cardHeight) { + this.cardHeight = cardHeight; + } } diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/cardtemplate/CardTemplateDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/cardtemplate/CardTemplateDTO.java index 7a5df97..fcdd6ab 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/cardtemplate/CardTemplateDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/cardtemplate/CardTemplateDTO.java @@ -48,6 +48,8 @@ public class CardTemplateDTO { private String isMain; @ApiModelProperty(name = "cardPersonId", value = "个人名片ID") private String cardPersonId; + @ApiModelProperty(name = "content", value = "个人名片详情") + private String content; public String getCardTemplateId() { return cardTemplateId == null ? "" : cardTemplateId.trim(); @@ -183,4 +185,12 @@ public class CardTemplateDTO { public void setCardPersonId(String cardPersonId) { this.cardPersonId = cardPersonId; } + + public String getContent() { + return content == null ? "" : content; + } + + public void setContent(String content) { + this.content = content; + } } diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/templateperson/TemplatePersonDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/templateperson/TemplatePersonDTO.java index 50aca03..1ff4ada 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/templateperson/TemplatePersonDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/templateperson/TemplatePersonDTO.java @@ -30,8 +30,12 @@ public class TemplatePersonDTO { private Integer cardOrder; @ApiModelProperty(name = "thumbnail", value = "预览图") private String thumbnail; - @ApiModelProperty(name = "isMain", value = "是否指定(0:否,1:是)") + @ApiModelProperty(name = "isMain", value = "是否置顶(0:否,1:是)") private Integer isMain; + @ApiModelProperty(name = "cardWidth", value = "名片宽度") + private String cardWidth; + @ApiModelProperty(name = "cardHeight", value = "名片高度") + private String cardHeight; public String getCardPersonId() { return cardPersonId == null ? "" : cardPersonId.trim(); @@ -104,4 +108,20 @@ public class TemplatePersonDTO { public void setIsMain(Integer isMain) { this.isMain = isMain; } + + public String getCardWidth() { + return cardWidth == null ? "" : cardWidth; + } + + public void setCardWidth(String cardWidth) { + this.cardWidth = cardWidth; + } + + public String getCardHeight() { + return cardHeight == null ? "" : cardHeight; + } + + public void setCardHeight(String cardHeight) { + this.cardHeight = cardHeight; + } } diff --git a/src/main/java/cn/com/tenlion/pojo/pos/templateperson/TemplatePersonPO.java b/src/main/java/cn/com/tenlion/pojo/pos/templateperson/TemplatePersonPO.java index d577181..c442a91 100644 --- a/src/main/java/cn/com/tenlion/pojo/pos/templateperson/TemplatePersonPO.java +++ b/src/main/java/cn/com/tenlion/pojo/pos/templateperson/TemplatePersonPO.java @@ -19,6 +19,8 @@ public class TemplatePersonPO { private Integer cardOrder; private String thumbnail; private Integer isMain; + private String cardWidth; + private String cardHeight; public String getCardPersonId() { return cardPersonId == null ? "" : cardPersonId.trim(); @@ -91,4 +93,20 @@ public class TemplatePersonPO { public void setIsMain(Integer isMain) { this.isMain = isMain; } + + public String getCardWidth() { + return cardWidth == null ? "" : cardWidth; + } + + public void setCardWidth(String cardWidth) { + this.cardWidth = cardWidth; + } + + public String getCardHeight() { + return cardHeight == null ? "" : cardHeight; + } + + public void setCardHeight(String cardHeight) { + this.cardHeight = cardHeight; + } } diff --git a/src/main/java/cn/com/tenlion/pojo/vos/templateperson/TemplatePersonVO.java b/src/main/java/cn/com/tenlion/pojo/vos/templateperson/TemplatePersonVO.java index a94e93c..4d534e6 100644 --- a/src/main/java/cn/com/tenlion/pojo/vos/templateperson/TemplatePersonVO.java +++ b/src/main/java/cn/com/tenlion/pojo/vos/templateperson/TemplatePersonVO.java @@ -34,6 +34,10 @@ public class TemplatePersonVO { private String thumbnail; @ApiModelProperty(name = "isMain", value = "是否置顶(0:否,1:是)") private Integer isMain; + @ApiModelProperty(name = "cardWidth", value = "名片宽度") + private String cardWidth; + @ApiModelProperty(name = "cardHeight", value = "名片高度") + private String cardHeight; public String getCardPersonId() { return cardPersonId == null ? "" : cardPersonId.trim(); @@ -106,4 +110,20 @@ public class TemplatePersonVO { public void setIsMain(Integer isMain) { this.isMain = isMain; } + + public String getCardWidth() { + return cardWidth == null ? "" : cardWidth; + } + + public void setCardWidth(String cardWidth) { + this.cardWidth = cardWidth; + } + + public String getCardHeight() { + return cardHeight == null ? "" : cardHeight; + } + + public void setCardHeight(String cardHeight) { + this.cardHeight = cardHeight; + } } diff --git a/src/main/java/cn/com/tenlion/service/templateperson/impl/TemplatePersonServiceImpl.java b/src/main/java/cn/com/tenlion/service/templateperson/impl/TemplatePersonServiceImpl.java index fb85644..1bcf3eb 100644 --- a/src/main/java/cn/com/tenlion/service/templateperson/impl/TemplatePersonServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/templateperson/impl/TemplatePersonServiceImpl.java @@ -116,11 +116,11 @@ public class TemplatePersonServiceImpl extends DefaultBaseService implements ITe setAppUpdateInfo(token, params); } if(!com.alibaba.excel.util.StringUtils.isEmpty(params.get("isMain"))) { - if("1".equals(params.get("isMain"))) { + if(1 == Integer.parseInt(params.get("isMain").toString())) { templatePersonDao.updateAllIsMain(params); + templatePersonDao.update(params); } } - templatePersonDao.update(params); } @Override @@ -161,6 +161,15 @@ public class TemplatePersonServiceImpl extends DefaultBaseService implements ITe @Override public List list(Map params) { + String token = null; + if(!com.alibaba.excel.util.StringUtils.isEmpty(params.get("token"))) { + token = params.get("token").toString(); + } + if (StringUtils.isBlank(token)) { + setSaveInfo(params); + } else { + setAppSaveInfo(token, params); + } return templatePersonDao.list(params); } diff --git a/src/main/resources/mybatis/mapper/cardtemplate/cardtemplate-mapper.xml b/src/main/resources/mybatis/mapper/cardtemplate/cardtemplate-mapper.xml index bbf1d96..d715b8a 100644 --- a/src/main/resources/mybatis/mapper/cardtemplate/cardtemplate-mapper.xml +++ b/src/main/resources/mybatis/mapper/cardtemplate/cardtemplate-mapper.xml @@ -20,6 +20,7 @@ + @@ -165,17 +166,21 @@ t1.template_order, t1.template_charge, t1.template_preview_photo, - t1.card_template_id, - t2.is_main, - t2.card_person_id - FROM - card_template t1 LEFT JOIN card_template_person t2 ON t1.card_template_id = t2.template_id - AND t2.is_delete = 0 - - AND - t2.modifier = #{modifier} - + t2.is_main, + t2.card_person_id, + t2.content, + + t1.card_template_id + FROM + card_template t1 + + LEFT JOIN card_template_person t2 ON t1.card_template_id = t2.template_id + AND t2.is_delete = 0 + + AND + t2.modifier = #{modifier} + AND t2.card_person_id = #{cardPersonId} diff --git a/src/main/resources/mybatis/mapper/templateperson/templatePerson-mapper.xml b/src/main/resources/mybatis/mapper/templateperson/templatePerson-mapper.xml index 3414dd6..0da31cd 100644 --- a/src/main/resources/mybatis/mapper/templateperson/templatePerson-mapper.xml +++ b/src/main/resources/mybatis/mapper/templateperson/templatePerson-mapper.xml @@ -12,6 +12,8 @@ + + @@ -29,6 +31,8 @@ + + @@ -46,6 +50,8 @@ + + @@ -65,6 +71,8 @@ card_order, thumbnail, is_main, + card_width, + card_height, creator, gmt_create, modifier, @@ -80,6 +88,8 @@ #{cardOrder}, #{thumbnail}, #{isMain}, + #{cardWidth}, + #{cardHeight}, #{creator}, #{gmtCreate}, #{modifier}, @@ -143,6 +153,12 @@ is_main = #{isMain}, + + card_width = #{cardWidth}, + + + card_height = #{cardHeight}, + creator = #{creator}, @@ -174,6 +190,8 @@ t1.card_order, t1.thumbnail, t1.is_main, + t1.card_width, + t1.card_height, 1 FROM card_template_person t1 @@ -193,6 +211,8 @@ t1.card_order, t1.thumbnail, t1.is_main, + t1.card_width, + t1.card_height, t1.source FROM card_template_person t1 @@ -212,6 +232,8 @@ t1.card_order, t1.thumbnail, t1.is_main, + t1.card_width, + t1.card_height, t1.source FROM card_template_person t1 @@ -223,20 +245,26 @@