个人名片bug修改。

名片卡包bug修改。
个人名片功能修改。
名片卡包功能修改。
This commit is contained in:
Renpc-kilig 2021-04-21 14:52:34 +08:00
parent a74fab8d91
commit cccd96eb03
13 changed files with 238 additions and 12 deletions

View File

@ -26,6 +26,7 @@ import java.util.Map;
* @Author: WenG
* @Date: 2021-01-28 11:08
* @Version: 1.0
* @Version: 1.0
**/
@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "名片/海报模板接口")
@RestController
@ -80,13 +81,15 @@ public class CardTemplateAppController extends AbstractController {
@ApiOperation(value = "名片/海报模板详情(通过ID)", notes = "名片/海报模板详情(通过ID)接口")
@ApiImplicitParams({
//@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "cardTemplateId", value = "名片/海报模板ID", paramType = "path")
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "cardTemplateId", value = "名片/海报模板ID", paramType = "path"),
@ApiImplicitParam(name = "cardPersonId", value = "个人名片ID", paramType = "query")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("getcardtemplatebyid/{cardTemplateId}")
public CardTemplateDTO getCardTemplateById(@PathVariable("cardTemplateId") String cardTemplateId) throws SearchException {
return cardTemplateService.getCardTemplateById(cardTemplateId);
public CardTemplateDTO getCardTemplateById(@RequestHeader("token") String token, @PathVariable("cardTemplateId") String cardTemplateId) throws SearchException {
Map<String, Object> params = requestParams();
return cardTemplateService.getCardTemplateById(params, token, cardTemplateId);
}
@ApiOperation(value = "名片/海报模板列表", notes = "名片/海报模板列表接口")

View File

@ -117,4 +117,10 @@ public interface ITemplatePersonDao {
*/
Integer count(Map<String, Object> params) throws SearchException;
/**
* 修改所有数据为非置顶状态
* @param params
* @throws UpdateException
*/
void updateAllIsMain(Map<String, Object> params) throws UpdateException;
}

View File

@ -16,6 +16,9 @@ public class TemplatePersonBO {
private String templateId;
private String content;
private Integer source;
private Integer cardOrder;
private String thumbnail;
private Integer isMain;
public String getCardPersonId() {
return cardPersonId == null ? "" : cardPersonId.trim();
@ -64,4 +67,28 @@ public class TemplatePersonBO {
public void setSource(Integer source) {
this.source = source;
}
public Integer getCardOrder() {
return cardOrder;
}
public void setCardOrder(Integer cardOrder) {
this.cardOrder = cardOrder;
}
public String getThumbnail() {
return thumbnail == null ? "" : thumbnail;
}
public void setThumbnail(String thumbnail) {
this.thumbnail = thumbnail;
}
public Integer getIsMain() {
return isMain;
}
public void setIsMain(Integer isMain) {
this.isMain = isMain;
}
}

View File

@ -44,6 +44,10 @@ public class CardTemplateDTO {
private Integer templateCharge;
@ApiModelProperty(name = "templatePreviewPhoto", value = "模板预览图片")
private String templatePreviewPhoto;
@ApiModelProperty(name = "isMain", value = "是否主名片01")
private String isMain;
@ApiModelProperty(name = "cardPersonId", value = "个人名片ID")
private String cardPersonId;
public String getCardTemplateId() {
return cardTemplateId == null ? "" : cardTemplateId.trim();
@ -164,5 +168,19 @@ public class CardTemplateDTO {
this.templatePreviewPhoto = templatePreviewPhoto;
}
public String getIsMain() {
return isMain == null ? "" : isMain;
}
public void setIsMain(String isMain) {
this.isMain = isMain;
}
public String getCardPersonId() {
return cardPersonId == null ? "" : cardPersonId;
}
public void setCardPersonId(String cardPersonId) {
this.cardPersonId = cardPersonId;
}
}

View File

@ -26,6 +26,12 @@ public class TemplatePersonDTO {
private String content;
@ApiModelProperty(name = "source", value = "数据来源,0:个人创建1:扫码")
private Integer source;
@ApiModelProperty(name = "cardOrder", value = "排序")
private Integer cardOrder;
@ApiModelProperty(name = "thumbnail", value = "预览图")
private String thumbnail;
@ApiModelProperty(name = "isMain", value = "是否指定01")
private Integer isMain;
public String getCardPersonId() {
return cardPersonId == null ? "" : cardPersonId.trim();
@ -74,4 +80,28 @@ public class TemplatePersonDTO {
public void setSource(Integer source) {
this.source = source;
}
public Integer getCardOrder() {
return cardOrder;
}
public void setCardOrder(Integer cardOrder) {
this.cardOrder = cardOrder;
}
public String getThumbnail() {
return thumbnail == null ? "" : thumbnail;
}
public void setThumbnail(String thumbnail) {
this.thumbnail = thumbnail;
}
public Integer getIsMain() {
return isMain;
}
public void setIsMain(Integer isMain) {
this.isMain = isMain;
}
}

View File

@ -16,6 +16,9 @@ public class TemplatePersonPO {
private String templateId;
private String content;
private Integer source;
private Integer cardOrder;
private String thumbnail;
private Integer isMain;
public String getCardPersonId() {
return cardPersonId == null ? "" : cardPersonId.trim();
@ -64,4 +67,28 @@ public class TemplatePersonPO {
public void setSource(Integer source) {
this.source = source;
}
public Integer getCardOrder() {
return cardOrder;
}
public void setCardOrder(Integer cardOrder) {
this.cardOrder = cardOrder;
}
public String getThumbnail() {
return thumbnail == null ? "" : thumbnail;
}
public void setThumbnail(String thumbnail) {
this.thumbnail = thumbnail;
}
public Integer getIsMain() {
return isMain;
}
public void setIsMain(Integer isMain) {
this.isMain = isMain;
}
}

View File

@ -28,6 +28,12 @@ public class TemplatePersonVO {
private String content;
@ApiModelProperty(name = "source", value = "数据来源,0:个人创建1:扫码")
private Integer source;
@ApiModelProperty(name = "cardOrder", value = "排序")
private Integer cardOrder;
@ApiModelProperty(name = "thumbnail", value = "预览图")
private String thumbnail;
@ApiModelProperty(name = "isMain", value = "是否置顶01")
private Integer isMain;
public String getCardPersonId() {
return cardPersonId == null ? "" : cardPersonId.trim();
@ -76,4 +82,28 @@ public class TemplatePersonVO {
public void setSource(Integer source) {
this.source = source;
}
public Integer getCardOrder() {
return cardOrder;
}
public void setCardOrder(Integer cardOrder) {
this.cardOrder = cardOrder;
}
public String getThumbnail() {
return thumbnail == null ? "" : thumbnail;
}
public void setThumbnail(String thumbnail) {
this.thumbnail = thumbnail;
}
public Integer getIsMain() {
return isMain == null ? 0 : isMain;
}
public void setIsMain(Integer isMain) {
this.isMain = isMain;
}
}

View File

@ -55,11 +55,13 @@ public interface ICardTemplateService {
/**
* 名片/海报模板详情(通过ID)
*
* @param params
* @param token
* @param cardTemplateId
* @return
* @throws SearchException
*/
CardTemplateDTO getCardTemplateById(String cardTemplateId) throws SearchException;
CardTemplateDTO getCardTemplateById(Map<String, Object> params, String token, String cardTemplateId) throws SearchException;
/**
* 判断编码是否存在

View File

@ -16,6 +16,7 @@ import ink.wgink.pojo.result.SuccessResultData;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.util.UUIDUtil;
import ink.wgink.util.map.HashMapUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
@ -76,8 +77,13 @@ public class CardTemplateServiceImpl extends AbstractService implements ICardTem
}
@Override
public CardTemplateDTO getCardTemplateById(String cardTemplateId) throws SearchException {
Map<String, Object> params = super.getHashMap(1);
public CardTemplateDTO getCardTemplateById(Map<String, Object> params, String token, String cardTemplateId) throws SearchException {
if(null == params) {
params = super.getHashMap(1);
}
if (!StringUtils.isBlank(token)) {
setAppUpdateInfo(token, params);
}
params.put("cardTemplateId", cardTemplateId);
return cardTemplateDao.getCardTemplate(params);
}
@ -103,7 +109,7 @@ public class CardTemplateServiceImpl extends AbstractService implements ICardTem
@Override
public SuccessResult updateCardTemplateImage(String cardTemplateId, String templatePreviewPhoto) throws Exception {
Map<String, Object> params = HashMapUtil.beanToMap(null);
Map<String, Object> params = new HashMap<>(1);
params.put("cardTemplateId", cardTemplateId);
params.put("templatePreviewPhoto", templatePreviewPhoto);
cardTemplateDao.updateCardTemplateImage(params);

View File

@ -55,7 +55,7 @@ public class CardTemplateUseServiceImpl extends AbstractService implements ICard
* 查询模板名称
* 存储快照名称
*/
CardTemplateDTO templateDto = cardTemplateService.getCardTemplateById(cardTemplateUseVO.getTemplateId());
CardTemplateDTO templateDto = cardTemplateService.getCardTemplateById(null, null, cardTemplateUseVO.getTemplateId());
if(templateDto == null) {
throw new SaveException("该模板不存在");
}

View File

@ -115,6 +115,11 @@ public class TemplatePersonServiceImpl extends DefaultBaseService implements ITe
} else {
setAppUpdateInfo(token, params);
}
if(!com.alibaba.excel.util.StringUtils.isEmpty(params.get("isMain"))) {
if("1".equals(params.get("isMain"))) {
templatePersonDao.updateAllIsMain(params);
}
}
templatePersonDao.update(params);
}

View File

@ -18,6 +18,8 @@
<result column="template_order" property="templateOrder"/>
<result column="template_charge" property="templateCharge"/>
<result column="template_preview_photo" property="templatePreviewPhoto"/>
<result column="is_main" property="isMain"/>
<result column="card_person_id" property="cardPersonId"/>
</resultMap>
<!-- 新增名片/海报模板 -->
@ -163,9 +165,20 @@
t1.template_order,
t1.template_charge,
t1.template_preview_photo,
t1.card_template_id
t1.card_template_id,
t2.is_main,
t2.card_person_id
FROM
card_template t1
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 != ''">
AND
t2.card_person_id = #{cardPersonId}
</if>
WHERE
t1.is_delete = 0
<if test="cardTemplateId != null and cardTemplateId != ''">

View File

@ -9,6 +9,9 @@
<result column="template_id" property="templateId"/>
<result column="content" property="content"/>
<result column="source" property="source"/>
<result column="card_order" property="cardOrder"/>
<result column="thumbnail" property="thumbnail"/>
<result column="is_main" property="isMain"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
@ -23,6 +26,9 @@
<result column="template_id" property="templateId"/>
<result column="content" property="content"/>
<result column="source" property="source"/>
<result column="card_order" property="cardOrder"/>
<result column="thumbnail" property="thumbnail"/>
<result column="is_main" property="isMain"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
@ -37,6 +43,9 @@
<result column="template_id" property="templateId"/>
<result column="content" property="content"/>
<result column="source" property="source"/>
<result column="card_order" property="cardOrder"/>
<result column="thumbnail" property="thumbnail"/>
<result column="is_main" property="isMain"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
@ -53,6 +62,9 @@
template_id,
content,
source,
card_order,
thumbnail,
is_main,
creator,
gmt_create,
modifier,
@ -65,6 +77,9 @@
#{templateId},
#{content},
#{source},
#{cardOrder},
#{thumbnail},
#{isMain},
#{creator},
#{gmtCreate},
#{modifier},
@ -82,7 +97,10 @@
modifier = #{modifier},
is_delete = 1
WHERE
card_person_id = #{cardPersonId}
card_person_id IN
<foreach collection="templatePersonIds" index="index" open="(" separator="," close=")">
#{templatePersonIds[${index}]}
</foreach>
</update>
<!-- 删除(物理) -->
@ -116,6 +134,15 @@
<if test="source != null and source != ''">
source = #{source},
</if>
<if test="cardOrder != null and cardOrder != ''">
card_order = #{cardOrder},
</if>
<if test="thumbnail != null and thumbnail != ''">
thumbnail = #{thumbnail},
</if>
<if test="isMain != null and isMain != ''">
is_main = #{isMain},
</if>
<if test="creator != null and creator != ''">
creator = #{creator},
</if>
@ -144,6 +171,9 @@
t1.template_id,
t1.content,
t1.source,
t1.card_order,
t1.thumbnail,
t1.is_main,
1
FROM
card_template_person t1
@ -160,6 +190,9 @@
t1.card_name,
t1.template_id,
t1.content,
t1.card_order,
t1.thumbnail,
t1.is_main,
t1.source
FROM
card_template_person t1
@ -176,6 +209,9 @@
t1.card_name,
t1.template_id,
t1.content,
t1.card_order,
t1.thumbnail,
t1.is_main,
t1.source
FROM
card_template_person t1
@ -193,6 +229,9 @@
t1.template_id,
t1.content,
t1.source,
t1.card_order,
t1.thumbnail,
t1.is_main,
1
FROM
card_template_person t1
@ -212,6 +251,7 @@
AND
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if>
ORDER BY t1.card_order
</select>
<!-- 列表 -->
@ -222,6 +262,9 @@
t1.card_name,
t1.template_id,
t1.content,
t1.card_order,
t1.thumbnail,
t1.is_main,
t1.source
FROM
card_template_person t1
@ -241,6 +284,7 @@
AND
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if>
ORDER BY t1.card_order
</select>
<!-- 列表 -->
@ -251,6 +295,9 @@
t1.card_name,
t1.template_id,
t1.content,
t1.card_order,
t1.thumbnail,
t1.is_main,
t1.source
FROM
card_template_person t1
@ -270,6 +317,7 @@
AND
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if>
ORDER BY t1.card_order
</select>
<!-- 统计 -->
@ -282,4 +330,15 @@
t1.is_delete = 0
</select>
<update id="updateAllIsMain" parameterType="map">
UPDATE
card_template_person
SET
is_main = 0
WHERE
is_delete = 0
AND creator = #{modifier}
OR modifier = #{modifier}
</update>
</mapper>