bug修改。

This commit is contained in:
Renpc-kilig 2021-04-23 18:45:21 +08:00
parent 0fbb22e248
commit e28897818e
9 changed files with 158 additions and 25 deletions

View File

@ -90,6 +90,7 @@ public class TemplatePersonAppController extends DefaultBaseController {
@GetMapping("list")
public List<TemplatePersonDTO> list(@RequestHeader("token") String token) {
Map<String, Object> params = requestParams();
params.put("token", token);
return templatePersonService.list(params);
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -30,8 +30,12 @@ public class TemplatePersonDTO {
private Integer cardOrder;
@ApiModelProperty(name = "thumbnail", value = "预览图")
private String thumbnail;
@ApiModelProperty(name = "isMain", value = "是否指定01")
@ApiModelProperty(name = "isMain", value = "是否置顶01")
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;
}
}

View File

@ -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;
}
}

View File

@ -34,6 +34,10 @@ public class TemplatePersonVO {
private String thumbnail;
@ApiModelProperty(name = "isMain", value = "是否置顶01")
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;
}
}

View File

@ -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<TemplatePersonDTO> list(Map<String, Object> 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);
}

View File

@ -20,6 +20,7 @@
<result column="template_preview_photo" property="templatePreviewPhoto"/>
<result column="is_main" property="isMain"/>
<result column="card_person_id" property="cardPersonId"/>
<result column="content" property="content"/>
</resultMap>
<!-- 新增名片/海报模板 -->
@ -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
<if test="modifier != null and modifier != ''">
AND
t2.modifier = #{modifier}
</if>
<if test="cardPersonId != null and cardPersonId != ''">
t2.is_main,
t2.card_person_id,
t2.content,
</if>
t1.card_template_id
FROM
card_template t1
<if test="cardPersonId != null and cardPersonId != ''">
LEFT JOIN card_template_person t2 ON t1.card_template_id = t2.template_id
AND t2.is_delete = 0
<if test="modifier != null and modifier != ''">
AND
t2.modifier = #{modifier}
</if>
AND
t2.card_person_id = #{cardPersonId}
</if>

View File

@ -12,6 +12,8 @@
<result column="card_order" property="cardOrder"/>
<result column="thumbnail" property="thumbnail"/>
<result column="is_main" property="isMain"/>
<result column="card_width" property="cardWidth"/>
<result column="card_height" property="cardHeight"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
@ -29,6 +31,8 @@
<result column="card_order" property="cardOrder"/>
<result column="thumbnail" property="thumbnail"/>
<result column="is_main" property="isMain"/>
<result column="card_width" property="cardWidth"/>
<result column="card_height" property="cardHeight"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
@ -46,6 +50,8 @@
<result column="card_order" property="cardOrder"/>
<result column="thumbnail" property="thumbnail"/>
<result column="is_main" property="isMain"/>
<result column="card_width" property="cardWidth"/>
<result column="card_height" property="cardHeight"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
@ -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 @@
<if test="isMain != null and isMain != ''">
is_main = #{isMain},
</if>
<if test="cardWidth != null and cardWidth != ''">
card_width = #{cardWidth},
</if>
<if test="cardHeight != null and cardHeight != ''">
card_height = #{cardHeight},
</if>
<if test="creator != null and creator != ''">
creator = #{creator},
</if>
@ -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 @@
<!-- 列表 -->
<select id="list" parameterType="map" resultMap="templatePersonDTO">
SELECT
t1.card_person_id,
t1.background_id,
t1.card_name,
t1.template_id,
t1.content,
t1.source,
t1.card_order,
t1.thumbnail,
t1.is_main,
1
t1.card_person_id,
t1.background_id,
t1.card_name,
t1.template_id,
t1.content,
t1.source,
t1.card_order,
t1.thumbnail,
t1.is_main,
t1.card_width,
t1.card_height,
1
FROM
card_template_person t1
card_template_person t1
WHERE
t1.is_delete = 0
t1.is_delete = 0
<if test="creator != null and creator != ''">
AND
t1.creator = #{creator}
</if>
<if test="keywords != null and keywords != ''">
AND (
<!-- 这里添加其他条件 -->
@ -265,6 +293,8 @@
t1.card_order,
t1.thumbnail,
t1.is_main,
t1.card_width,
t1.card_height,
t1.source
FROM
card_template_person t1
@ -298,6 +328,8 @@
t1.card_order,
t1.thumbnail,
t1.is_main,
t1.card_width,
t1.card_height,
t1.source
FROM
card_template_person t1