diff --git a/src/main/java/cn/com/tenlion/systemcard/controller/api/cardtemplatescans/CardTemplateScansController.java b/src/main/java/cn/com/tenlion/systemcard/controller/api/cardtemplatescans/CardTemplateScansController.java index 4a23864..b1c868c 100644 --- a/src/main/java/cn/com/tenlion/systemcard/controller/api/cardtemplatescans/CardTemplateScansController.java +++ b/src/main/java/cn/com/tenlion/systemcard/controller/api/cardtemplatescans/CardTemplateScansController.java @@ -87,6 +87,7 @@ public class CardTemplateScansController extends DefaultBaseController { @ApiOperation(value = "分页列表", notes = "分页列表接口") @ApiImplicitParams({ + @ApiImplicitParam(name = "homePage", value = "是否为首页(1:首页,需要将系统默认的名片置顶返回)", paramType = "query", dataType = "int", defaultValue = "0"), @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), diff --git a/src/main/java/cn/com/tenlion/systemcard/pojo/dtos/cardtemplate/CardTemplateAppDTO.java b/src/main/java/cn/com/tenlion/systemcard/pojo/dtos/cardtemplate/CardTemplateAppDTO.java index edebe9a..46f12da 100644 --- a/src/main/java/cn/com/tenlion/systemcard/pojo/dtos/cardtemplate/CardTemplateAppDTO.java +++ b/src/main/java/cn/com/tenlion/systemcard/pojo/dtos/cardtemplate/CardTemplateAppDTO.java @@ -35,6 +35,26 @@ public class CardTemplateAppDTO extends PicturesTemplateBuildingDTO { private String templateCharge; @ApiModelProperty(name = "templateStatus", value = "是否发布1:发布,0:停用") private String templateStatus; + @ApiModelProperty(name = "templatePrice", value = "收费价格") + private Double templatePrice; + @ApiModelProperty(name = "templateCompany", value = "企业定制模板") + private String templateCompany; + + public String getTemplateCompany() { + return templateCompany == null ? "" : templateCompany; + } + + public void setTemplateCompany(String templateCompany) { + this.templateCompany = templateCompany; + } + + public Double getTemplatePrice() { + return templatePrice == null ? 0.0 : templatePrice; + } + + public void setTemplatePrice(Double templatePrice) { + this.templatePrice = templatePrice; + } public String getCardTemplateId() { return cardTemplateId == null ? "" : cardTemplateId; diff --git a/src/main/java/cn/com/tenlion/systemcard/pojo/dtos/cardtemplate/CardTemplateDTO.java b/src/main/java/cn/com/tenlion/systemcard/pojo/dtos/cardtemplate/CardTemplateDTO.java index 9205809..c6aac79 100644 --- a/src/main/java/cn/com/tenlion/systemcard/pojo/dtos/cardtemplate/CardTemplateDTO.java +++ b/src/main/java/cn/com/tenlion/systemcard/pojo/dtos/cardtemplate/CardTemplateDTO.java @@ -24,6 +24,10 @@ public class CardTemplateDTO { private String templateIndustry; @ApiModelProperty(name = "templateCharge", value = "是否收费1:收费,0:免费") private String templateCharge; + @ApiModelProperty(name = "templatePrice", value = "收费价格") + private Double templatePrice; + @ApiModelProperty(name = "templateCompany", value = "企业定制模板") + private String templateCompany; @ApiModelProperty(name = "templateStatus", value = "是否发布1:发布,0:停用") private String templateStatus; @ApiModelProperty(name = "creator", value = "") @@ -37,6 +41,22 @@ public class CardTemplateDTO { @ApiModelProperty(name = "isDelete", value = "") private Integer isDelete; + public Double getTemplatePrice() { + return templatePrice; + } + + public void setTemplatePrice(Double templatePrice) { + this.templatePrice = templatePrice; + } + + public String getTemplateCompany() { + return templateCompany == null ? "" : templateCompany; + } + + public void setTemplateCompany(String templateCompany) { + this.templateCompany = templateCompany; + } + public String getCardTemplateId() { return cardTemplateId == null ? "" : cardTemplateId.trim(); } diff --git a/src/main/java/cn/com/tenlion/systemcard/pojo/vos/cardtemplate/CardTemplateVO.java b/src/main/java/cn/com/tenlion/systemcard/pojo/vos/cardtemplate/CardTemplateVO.java index 7464811..f6794ce 100644 --- a/src/main/java/cn/com/tenlion/systemcard/pojo/vos/cardtemplate/CardTemplateVO.java +++ b/src/main/java/cn/com/tenlion/systemcard/pojo/vos/cardtemplate/CardTemplateVO.java @@ -31,6 +31,26 @@ public class CardTemplateVO { @ApiModelProperty(name = "templateStatus", value = "是否发布1:发布,0:停用") @CheckEmptyAnnotation(name = "模板开关") private String templateStatus; + @ApiModelProperty(name = "templatePrice", value = "收费价格") + private Double templatePrice; + @ApiModelProperty(name = "templateCompany", value = "企业定制模板") + private String templateCompany; + + public Double getTemplatePrice() { + return templatePrice == null ? 0.0 : templatePrice; + } + + public void setTemplatePrice(Double templatePrice) { + this.templatePrice = templatePrice; + } + + public String getTemplateCompany() { + return templateCompany == null ? "" : templateCompany; + } + + public void setTemplateCompany(String templateCompany) { + this.templateCompany = templateCompany; + } public String getTemplateMode() { return templateMode == null ? "" : templateMode.trim(); diff --git a/src/main/java/cn/com/tenlion/systemcard/service/cardtemplatescans/impl/CardTemplateScansServiceImpl.java b/src/main/java/cn/com/tenlion/systemcard/service/cardtemplatescans/impl/CardTemplateScansServiceImpl.java index 91ff728..43dddb8 100644 --- a/src/main/java/cn/com/tenlion/systemcard/service/cardtemplatescans/impl/CardTemplateScansServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemcard/service/cardtemplatescans/impl/CardTemplateScansServiceImpl.java @@ -240,8 +240,23 @@ public class CardTemplateScansServiceImpl extends DefaultBaseService implements public SuccessResultList> listPage(ListPage page) { PageHelper.startPage(page.getPage(), page.getRows()); List cardTemplateScansDTOs = list(page.getParams()); - PageInfo pageInfo = new PageInfo<>(cardTemplateScansDTOs); - return new SuccessResultList<>(cardTemplateScansDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + // 加载系统默认名片在最上面 + if(1 == page.getPage() && page.getParams().get("homePage") != null && 1 == Integer.valueOf(page.getParams().get("homePage").toString())) { + CardTemplateUseDTO cardTemplateUseDTO = iCardTemplateUseService.getSystemCard(); + List cardTemplateScansDTOList = new ArrayList(); + if(cardTemplateUseDTO != null) { + CardTemplateScansDTO scansDTO = new CardTemplateScansDTO(); + scansDTO.setCardTemplateUseId(cardTemplateUseDTO.getCardTemplateUseId()); + scansDTO.setCardTemplateUseDTO(cardTemplateUseDTO); + cardTemplateScansDTOList.add(scansDTO); + } + cardTemplateScansDTOList.addAll(cardTemplateScansDTOs); + PageInfo pageInfo = new PageInfo<>(cardTemplateScansDTOList); + return new SuccessResultList<>(cardTemplateScansDTOList, pageInfo.getPageNum(), pageInfo.getTotal()); + }else { + PageInfo pageInfo = new PageInfo<>(cardTemplateScansDTOs); + return new SuccessResultList<>(cardTemplateScansDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } } @Override diff --git a/src/main/java/cn/com/tenlion/systemcard/service/cardtemplateuse/impl/CardTemplateUseServiceImpl.java b/src/main/java/cn/com/tenlion/systemcard/service/cardtemplateuse/impl/CardTemplateUseServiceImpl.java index 6718e2c..23b3cd8 100644 --- a/src/main/java/cn/com/tenlion/systemcard/service/cardtemplateuse/impl/CardTemplateUseServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemcard/service/cardtemplateuse/impl/CardTemplateUseServiceImpl.java @@ -5,6 +5,7 @@ import cn.com.tenlion.buildingpictures.pojo.dtos.picturestemplatearea.PicturesTe import cn.com.tenlion.buildingpictures.service.picturestemplatebuilding.IPicturesTemplateBuildingService; import cn.com.tenlion.buildingpictures.util.CreateImageBean; import cn.com.tenlion.buildingpictures.util.WeiXinBarCodeUtils; +import cn.com.tenlion.configcontent.util.AntistopUtil; import cn.com.tenlion.projectconfig.util.ProjectConfigUtil; import cn.com.tenlion.systemcard.pojo.dtos.cardtemplate.CardTemplateAppDTO; import cn.com.tenlion.systemcard.pojo.dtos.cardtemplate.CardTemplateDTO; @@ -243,6 +244,17 @@ public class CardTemplateUseServiceImpl extends DefaultBaseService implements IC areaVO.setTemplateAreaFontValue(cardTemplateUseAreaSaveVO.getTemplateAreaFontValue()); // 封装模板预览图参数 if(!StringUtils.isEmpty(cardTemplateUseAreaSaveVO.getTemplateAreaFontValue())) { + /** + * 判断评论是否违规 + */ + // 评论内容敏感词识别 + String viewContent = AntistopUtil.buiderView(cardTemplateUseAreaSaveVO.getTemplateAreaFontValue()); + // 敏感词触发次数 + int count = AntistopUtil.getCount(viewContent); + // 发生敏感词 + if(count > 0) { + throw new SaveException(buildingDTO.getTemplateAreaName() + "涉嫌违规"); + } buildingPicturesMap.put(buildingDTO.getTemplateAreaSource(), cardTemplateUseAreaSaveVO.getTemplateAreaFontValue()); }else if(!StringUtils.isEmpty(cardTemplateUseAreaSaveVO.getTemplateAreaFile())) { buildingPicturesMap.put(buildingDTO.getTemplateAreaSource(), cardTemplateUseAreaSaveVO.getTemplateAreaFile()); @@ -407,6 +419,17 @@ public class CardTemplateUseServiceImpl extends DefaultBaseService implements IC if (useAreaDTO.getCardTemplateUseAreaId().equals(cardTemplateUseAreaUpdateVO.getCardTemplateUseAreaId())) { // 封装模板预览图参数 if(!StringUtils.isEmpty(cardTemplateUseAreaUpdateVO.getTemplateAreaFontValue())) { + /** + * 判断评论是否违规 + */ + // 评论内容敏感词识别 + String viewContent = AntistopUtil.buiderView(cardTemplateUseAreaUpdateVO.getTemplateAreaFontValue()); + // 敏感词触发次数 + int count = AntistopUtil.getCount(viewContent); + // 发生敏感词 + if(count > 0) { + throw new SaveException(useAreaDTO.getTemplateAreaName() + "涉嫌违规"); + } buildingPicturesMap.put(useAreaDTO.getTemplateAreaSource(), cardTemplateUseAreaUpdateVO.getTemplateAreaFontValue()); }else if(!StringUtils.isEmpty(cardTemplateUseAreaUpdateVO.getTemplateAreaFile())) { buildingPicturesMap.put(useAreaDTO.getTemplateAreaSource(), cardTemplateUseAreaUpdateVO.getTemplateAreaFile()); @@ -584,9 +607,9 @@ public class CardTemplateUseServiceImpl extends DefaultBaseService implements IC */ params.put("userId", getUserId(token)); List list = list(params); - if(list == null || list.size() < 1) { - // 没有创建名片 , 显示系统默认名片 - CardTemplateUseDTO cardTemplateUseDTO = cardTemplateUseDao.getSystem(params); + if(list != null || list.size() > 0) { + // 创建了名片 , 加载我的默认名片 + CardTemplateUseDTO cardTemplateUseDTO = cardTemplateUseDao.getDefault(params); if(cardTemplateUseDTO == null) { return null; } @@ -596,8 +619,8 @@ public class CardTemplateUseServiceImpl extends DefaultBaseService implements IC cardTemplateUseDTO.setAreaList(useAreaList); return cardTemplateUseDTO; }else{ - // 创建了名片 , 加载我的默认名片 - CardTemplateUseDTO cardTemplateUseDTO = cardTemplateUseDao.getDefault(params); + // 没有创建名片 , 显示系统默认名片 + CardTemplateUseDTO cardTemplateUseDTO = cardTemplateUseDao.getSystem(params); if(cardTemplateUseDTO == null) { return null; } diff --git a/src/main/resources/mybatis/mapper/cardtemplate/card-template-mapper.xml b/src/main/resources/mybatis/mapper/cardtemplate/card-template-mapper.xml index 8e15384..83a13c0 100644 --- a/src/main/resources/mybatis/mapper/cardtemplate/card-template-mapper.xml +++ b/src/main/resources/mybatis/mapper/cardtemplate/card-template-mapper.xml @@ -9,6 +9,8 @@ + + @@ -53,6 +55,8 @@ template_industry, template_charge, template_status, + template_price, + template_company, creator, gmt_create, modifier, @@ -65,6 +69,8 @@ #{templateIndustry}, #{templateCharge}, #{templateStatus}, + #{templatePrice}, + #{templateCompany}, #{creator}, #{gmtCreate}, #{modifier}, @@ -119,6 +125,8 @@ template_status = #{templateStatus}, + template_price = #{templatePrice}, + template_company = #{templateCompany}, gmt_modified = #{gmtModified}, modifier = #{modifier}, card_template_id = card_template_id @@ -134,7 +142,9 @@ t1.template_industry, t1.template_charge, t1.template_status, - t1.card_template_id + t1.card_template_id, + t1.template_price, + t1.template_company FROM e_card_template t1 WHERE @@ -158,7 +168,9 @@ t1.gmt_create, t1.modifier, t1.gmt_modified, - t1.is_delete + t1.is_delete, + t1.template_price, + t1.template_company FROM e_card_template t1 WHERE @@ -182,7 +194,9 @@ t1.gmt_create, t1.modifier, t1.gmt_modified, - t1.is_delete + t1.is_delete, + t1.template_price, + t1.template_company FROM e_card_template t1 WHERE @@ -207,7 +221,8 @@ t1.modifier, t1.gmt_modified, t1.is_delete, - 1 + t1.template_price, + t1.template_company FROM e_card_template t1 WHERE @@ -254,7 +269,9 @@ t1.gmt_create, t1.modifier, t1.gmt_modified, - t1.is_delete + t1.is_delete, + t1.template_price, + t1.template_company FROM e_card_template t1 WHERE @@ -295,7 +312,9 @@ t1.gmt_create, t1.modifier, t1.gmt_modified, - t1.is_delete + t1.is_delete, + t1.template_price, + t1.template_company FROM e_card_template t1 WHERE diff --git a/src/main/resources/mybatis/mapper/cardtemplatescans/card-template-scans-mapper.xml b/src/main/resources/mybatis/mapper/cardtemplatescans/card-template-scans-mapper.xml index d3bd7d2..27beb31 100644 --- a/src/main/resources/mybatis/mapper/cardtemplatescans/card-template-scans-mapper.xml +++ b/src/main/resources/mybatis/mapper/cardtemplatescans/card-template-scans-mapper.xml @@ -218,6 +218,10 @@ t1.is_delete FROM e_card_template_scans t1 + LEFT JOIN + e_card_template_use t2 + ON + t1.card_template_use_id = t2.card_template_use_id WHERE t1.is_delete = 0 @@ -229,6 +233,10 @@ AND t1.card_template_use_id = #{cardTemplateUseId} + + + AND t2.card_template_use_system = '0' + ORDER BY t1.gmt_create DESC diff --git a/src/main/resources/static/route/cardtemplate/list-cardtemplate.html b/src/main/resources/static/route/cardtemplate/list-cardtemplate.html index de24f1d..2ee6748 100644 --- a/src/main/resources/static/route/cardtemplate/list-cardtemplate.html +++ b/src/main/resources/static/route/cardtemplate/list-cardtemplate.html @@ -210,7 +210,7 @@ if(picturesTemplateId == params[j].cardTemplateId) { $(".templateCharge" + picturesTemplateId).each(function(i, e) { if(params[j].templateCharge == 1) { - $(e).parent().html(''); + $(e).parent().html(''); }else { $(e).parent().html(''); } diff --git a/src/main/resources/static/route/cardtemplate/update-cardtemplate.html b/src/main/resources/static/route/cardtemplate/update-cardtemplate.html index 61b44a9..af7dfee 100644 --- a/src/main/resources/static/route/cardtemplate/update-cardtemplate.html +++ b/src/main/resources/static/route/cardtemplate/update-cardtemplate.html @@ -41,7 +41,24 @@
- + +
+
+
+ +
+ +
+
@@ -90,6 +107,17 @@ var viewerObj = {}; var picturesTemplateId = top.restAjax.params(window.location.href).picturesTemplateId; + form.on('switch(templateChargeFilter)', function (data) { + if(this.checked) { + laytpl(document.getElementById('templatePriceScript').innerHTML).render(this.checked, function(html) { + document.getElementById('templatePriceDiv').innerHTML = html; + form.render(null, 'dataForm'); + }); + }else{ + document.getElementById('templatePriceDiv').innerHTML = ""; + } + }); + // 初始化类型 function initTemplateType(templateType) { top.restAjax.get(top.restAjax.path('api/data/listbyparentid/4bf68c60-eac5-480d-b5e1-15203d0282f9', []), {}, null, function(code, data, args) { @@ -143,6 +171,12 @@ console.log(dataFormData); dataFormData.templateStatus = dataFormData.templateStatus == 1 ? true : false; dataFormData.templateCharge = dataFormData.templateCharge == 1 ? true : false; + if(dataFormData.templateCharge ) { + laytpl(document.getElementById('templatePriceScript').innerHTML).render(dataFormData.templateCharge, function(html) { + document.getElementById('templatePriceDiv').innerHTML = html; + form.render(null, 'dataForm'); + }); + } initTemplateIndustry(dataFormData.templateIndustry); initTemplateType(dataFormData.templateType);