Commit a87a0542 by fudahua

Merge remote-tracking branch 'origin/developer' into developer

parents c3b1e83f 8776e2f5
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
public class MaidianDictDTO implements Serializable {
private String dictId;
private String dictName;
private String dictData;
private String dictDescrible;
private String moduleId;
private Date createTime;
private Date updateTime;
private Integer status;
private String operationPerson;
private Integer loginFlag;
private Integer transitFlag;
private String code;
private static final long serialVersionUID = 1L;
public String getDictId() {
return dictId;
}
public void setDictId(String dictId) {
this.dictId = dictId == null ? null : dictId.trim();
}
public String getDictName() {
return dictName;
}
public void setDictName(String dictName) {
this.dictName = dictName == null ? null : dictName.trim();
}
public String getDictData() {
return dictData;
}
public void setDictData(String dictData) {
this.dictData = dictData == null ? null : dictData.trim();
}
public String getDictDescrible() {
return dictDescrible;
}
public void setDictDescrible(String dictDescrible) {
this.dictDescrible = dictDescrible == null ? null : dictDescrible.trim();
}
public String getModuleId() {
return moduleId;
}
public void setModuleId(String moduleId) {
this.moduleId = moduleId == null ? null : moduleId.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getOperationPerson() {
return operationPerson;
}
public void setOperationPerson(String operationPerson) {
this.operationPerson = operationPerson == null ? null : operationPerson.trim();
}
public Integer getLoginFlag() {
return loginFlag;
}
public void setLoginFlag(Integer loginFlag) {
this.loginFlag = loginFlag;
}
public Integer getTransitFlag() {
return transitFlag;
}
public void setTransitFlag(Integer transitFlag) {
this.transitFlag = transitFlag;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code == null ? null : code.trim();
}
}
\ No newline at end of file
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
public class MaidianDictModuleDTO implements Serializable {
private String moduleId;
private String moduleName;
private Date createTime;
private Date updateTime;
private Integer status;
private String operationPerson;
private static final long serialVersionUID = 1L;
public String getModuleId() {
return moduleId;
}
public void setModuleId(String moduleId) {
this.moduleId = moduleId == null ? null : moduleId.trim();
}
public String getModuleName() {
return moduleName;
}
public void setModuleName(String moduleName) {
this.moduleName = moduleName == null ? null : moduleName.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getOperationPerson() {
return operationPerson;
}
public void setOperationPerson(String operationPerson) {
this.operationPerson = operationPerson == null ? null : operationPerson.trim();
}
}
\ No newline at end of file
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
public class MaidianDictPageDTO implements Serializable {
private String moduleId;
private String moduleName;
private Date createTime;
private Date updateTime;
private Integer status;
private String operationPerson;
private List<MaidianDictDTO> pageList;
private static final long serialVersionUID = 1L;
public List<MaidianDictDTO> getPageList() {
return pageList;
}
public void setPageList(List<MaidianDictDTO> pageList) {
this.pageList = pageList;
}
public String getModuleId() {
return moduleId;
}
public void setModuleId(String moduleId) {
this.moduleId = moduleId == null ? null : moduleId.trim();
}
public String getModuleName() {
return moduleName;
}
public void setModuleName(String moduleName) {
this.moduleName = moduleName == null ? null : moduleName.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getOperationPerson() {
return operationPerson;
}
public void setOperationPerson(String operationPerson) {
this.operationPerson = operationPerson == null ? null : operationPerson.trim();
}
}
\ No newline at end of file
package com.gic.haoban.manage.api.dto;
import java.util.Date;
public class MaterialCategoryDTO {
private String categoryId;
private String categoryName;
private String categoryParentId;
private String wxEnterpriseId;
private Integer statusFlag;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public String getCategoryId() {
return categoryId;
}
public void setCategoryId(String categoryId) {
this.categoryId = categoryId == null ? null : categoryId.trim();
}
public String getCategoryName() {
return categoryName;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName == null ? null : categoryName.trim();
}
public String getCategoryParentId() {
return categoryParentId;
}
public void setCategoryParentId(String categoryParentId) {
this.categoryParentId = categoryParentId == null ? null : categoryParentId.trim();
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId == null ? null : wxEnterpriseId.trim();
}
public Integer getStatusFlag() {
return statusFlag;
}
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
package com.gic.haoban.manage.api.dto;
import java.util.Date;
public class MaterialDTO {
private String materialId;
private String materialTitle;
private Integer materialType;
private String categoryId;
private String materialContent;
private String wxLastUploadTime;
private String mediaId;
private String wxEnterpriseId;
private String staffId;
private String staffName;
private String imgUrl;
private String materialDesc;
private Integer statusFlag;
private String link;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public String getMaterialId() {
return materialId;
}
public void setMaterialId(String materialId) {
this.materialId = materialId == null ? null : materialId.trim();
}
public String getMaterialTitle() {
return materialTitle;
}
public void setMaterialTitle(String materialTitle) {
this.materialTitle = materialTitle == null ? null : materialTitle.trim();
}
public Integer getMaterialType() {
return materialType;
}
public void setMaterialType(Integer materialType) {
this.materialType = materialType;
}
public String getCategoryId() {
return categoryId;
}
public void setCategoryId(String categoryId) {
this.categoryId = categoryId == null ? null : categoryId.trim();
}
public String getMaterialContent() {
return materialContent;
}
public void setMaterialContent(String materialContent) {
this.materialContent = materialContent == null ? null : materialContent.trim();
}
public String getWxLastUploadTime() {
return wxLastUploadTime;
}
public void setWxLastUploadTime(String wxLastUploadTime) {
this.wxLastUploadTime = wxLastUploadTime == null ? null : wxLastUploadTime.trim();
}
public String getMediaId() {
return mediaId;
}
public void setMediaId(String mediaId) {
this.mediaId = mediaId == null ? null : mediaId.trim();
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId == null ? null : wxEnterpriseId.trim();
}
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId == null ? null : staffId.trim();
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName == null ? null : staffName.trim();
}
public String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl == null ? null : imgUrl.trim();
}
public String getMaterialDesc() {
return materialDesc;
}
public void setMaterialDesc(String materialDesc) {
this.materialDesc = materialDesc == null ? null : materialDesc.trim();
}
public Integer getStatusFlag() {
return statusFlag;
}
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link == null ? null : link.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
package com.gic.haoban.manage.api.service;
import java.util.List;
import com.gic.haoban.manage.api.dto.MaidianDictDTO;
import com.gic.haoban.manage.api.dto.MaidianDictModuleDTO;
import com.gic.haoban.manage.api.dto.MaidianDictPageDTO;
/**
* Created by tgs on 2020/2/9.
*/
public interface MaidianDictApiService {
void saveModule(MaidianDictModuleDTO dto);
void savePage(MaidianDictDTO dto);
void delPage(String dictId);
void delModule(String moduleId);
List<MaidianDictPageDTO> dictPage();
}
package com.gic.haoban.manage.api.service;
import java.util.List;
import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.manage.api.dto.MaterialCategoryDTO;
import com.gic.haoban.manage.api.dto.MaterialDTO;
public interface MaterialApiService {
boolean hasCategoryNameExsit(String categoryName, String categoryParentId,String categoryId);
void insertCategory(MaterialCategoryDTO materialCategoryDTO);
List<MaterialCategoryDTO> listCategory(String wxEnterpriseId);
MaterialCategoryDTO selectMaterialCategoryById(String categoryId);
void editCategory(MaterialCategoryDTO materialCategoryDTO);
List<MaterialDTO> listMaterialByCategoryId(String categoryId);
void insertMaterial(MaterialDTO materialDTO);
MaterialDTO selectMaterialById(String materialId);
void editMaterial(MaterialDTO materialDTO);
Page<MaterialDTO> listMaterial(String wxEnterpriseId, String keyword, String categoryId, Integer materialType,BasePageInfo pageInfo);
}
package com.gic.haoban.manage.api.service;
import java.util.Date;
import java.util.List;
import com.gic.haoban.manage.api.dto.MemberStoreDTO;
......@@ -17,6 +18,8 @@ public interface MemberUnionidRelatedApiService {
List<MemberUnionidRelatedDTO> getByWxUserIdAndWxEnterpriseId(String wxUserId, String wxEnterpriseId);
List<MemberUnionidRelatedDTO> listByWxEnterpriseIdAndDate(String wxEnterpriseId,Date date);
List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String wxUserId);
String add(String wxEnterpriseId, String selfExternalUserId, String userId1);
......
......@@ -18,7 +18,8 @@ public interface StaffApiService {
public List<StaffDTO> listByIds(List<String> staffIds);
public List<StaffDTO> listByWxUserId(String wxUserId);
public StaffDTO selectByNationcodeAndPhoneNumber(String wxEnterpriseId,String nationcode, String phoneNumber);
public ServiceResponse add(StaffDTO staff, String departmentIds);
......
......@@ -33,7 +33,7 @@ public interface StaffDepartmentRelatedApiService {
String getPageUrl(int type,String data);
//发送消息,单人发送
boolean sendSingleMessage(String wxUserId,String title,String content,String pageUrl);
boolean sendSingleMessage(String clerkId,String title,String content,String pageUrl);
List<StaffDepartmentRelatedDTO> listByStaffIds(List<String> staffIds);
......
package com.gic.haoban.manage.web.controller;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.csp.sentinel.util.StringUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.MaidianDictDTO;
import com.gic.haoban.manage.api.dto.MaidianDictModuleDTO;
import com.gic.haoban.manage.api.dto.MaidianDictPageDTO;
import com.gic.haoban.manage.api.service.MaidianDictApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
@RequestMapping("/maidian")
@RestController
public class MaidianDictController extends WebBaseController{
private static final String LOGIN_URL = "/haoban-manage3-web/yw-login";
private static Logger logger = LoggerFactory.getLogger(MaidianDictController.class);
@Autowired
private MaidianDictApiService maidianDictApiService;
//保存模块
@RequestMapping("save-module")
public HaobanResponse saveModule(MaidianDictModuleDTO dto) {
maidianDictApiService.saveModule(dto);
return resultResponse(HaoBanErrCode.ERR_1);
}
//保存字典
@RequestMapping("save-page")
public HaobanResponse savePage(MaidianDictDTO dto) {
if(StringUtil.isEmpty(dto.getModuleId())){
return resultResponse(HaoBanErrCode.ERR_2);
}
maidianDictApiService.savePage(dto);
return resultResponse(HaoBanErrCode.ERR_1);
}
//删除模块
@RequestMapping("del-module")
public HaobanResponse delModule(String moduleId) {
maidianDictApiService.delModule(moduleId);
return resultResponse(HaoBanErrCode.ERR_1);
}
//删除字典
@RequestMapping("del-page")
public HaobanResponse delPage(String dictId) {
maidianDictApiService.delPage(dictId);
return resultResponse(HaoBanErrCode.ERR_1);
}
//字典页面
@RequestMapping("dict-page")
public HaobanResponse dictPage( ) {
List<MaidianDictPageDTO> result = maidianDictApiService.dictPage();
return resultResponse(HaoBanErrCode.ERR_1,result);
}
}
......@@ -32,8 +32,6 @@
<dubbo:reference interface="com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService" id="staffDepartmentRelatedApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.DictApiService" id="dictApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.HelpApiService" id="helpApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.MaidianDictApiService" id="maidianDictApiService"/>
</beans>
package com.gic.haoban.manage.service.dao.mapper;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
......@@ -27,7 +28,9 @@ public interface MemberUnionidRelatedMapper {
void deleteByUnionidAndUserId(@Param("externalUserid")String externalUserid,@Param("wxUserId") String wxUserId);
List<MemberUnionidRelated> getByWxUserIdAndWxEnterpriseId(@Param("wxUserId")String wxUserId, @Param("wxEnterpriseId")String wxEnterpriseId);
List<MemberUnionidRelated> listByWxEnterpriseIdAndDate(@Param("wxEnterpriseId")String wxEnterpriseId,@Param("date")Date date);
MemberUnionidRelated getByParams(@Param("wxUserId")String wxUserId, @Param("enterpriseId")String enterpriseId,
@Param("externalName")String name, @Param("addCreateTime")String createTime);
......
......@@ -25,6 +25,8 @@ public interface StaffMapper {
List<TabHaobanStaff> listByIds(@Param("staffIds")List<String> staffIds);
List<TabHaobanStaff> listByWxUserId(@Param("wxUserId")String wxUserId);
List<TabHaobanStaff> listLikeName(@Param("staffName")String staffName);
Page<TabHaobanStaff> pageStaff(@Param("staffIds")Set<String> staffIds, @Param("activeFlag")Integer activeFlag, @Param("keyword")String keyword);
......
package com.gic.haoban.manage.service.dao.mapper;
import java.util.List;
import com.gic.haoban.manage.service.entity.TabHaobanMaidianDict;
public interface TabHaobanMaidianDictMapper {
int deleteByPrimaryKey(String dictId);
int insert(TabHaobanMaidianDict record);
int insertSelective(TabHaobanMaidianDict record);
TabHaobanMaidianDict selectByPrimaryKey(String dictId);
int updateByPrimaryKeySelective(TabHaobanMaidianDict record);
int updateByPrimaryKey(TabHaobanMaidianDict record);
List<TabHaobanMaidianDict> listByModuleId(String moduleId);
}
\ No newline at end of file
package com.gic.haoban.manage.service.dao.mapper;
import java.util.List;
import com.gic.haoban.manage.service.entity.TabHaobanMaidianDictModule;
public interface TabHaobanMaidianDictModuleMapper {
int deleteByPrimaryKey(String moduleId);
int insert(TabHaobanMaidianDictModule record);
int insertSelective(TabHaobanMaidianDictModule record);
TabHaobanMaidianDictModule selectByPrimaryKey(String moduleId);
int updateByPrimaryKeySelective(TabHaobanMaidianDictModule record);
int updateByPrimaryKey(TabHaobanMaidianDictModule record);
List<TabHaobanMaidianDictModule> list();
}
\ No newline at end of file
package com.gic.haoban.manage.service.dao.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.gic.haoban.manage.api.dto.MaterialCategoryDTO;
import com.gic.haoban.manage.service.entity.TabHaobanMaterialCategory;
public interface TabHaobanMaterialCategoryMapper {
int deleteByPrimaryKey(String categoryId);
int insert(TabHaobanMaterialCategory record);
int insertSelective(TabHaobanMaterialCategory record);
TabHaobanMaterialCategory selectByPrimaryKey(String categoryId);
int updateByPrimaryKeySelective(TabHaobanMaterialCategory record);
int updateByPrimaryKey(TabHaobanMaterialCategory record);
TabHaobanMaterialCategory selectByCategoryNameAndParentId(@Param("categoryName")String categoryName, @Param("categoryParentId")String categoryParentId);
List<TabHaobanMaterialCategory> listCategory(@Param("wxEnterpriseId")String wxEnterpriseId);
}
\ No newline at end of file
package com.gic.haoban.manage.service.dao.mapper;
import org.apache.ibatis.annotations.Param;
import com.gic.haoban.manage.service.entity.TabHaobanMaterial;
import com.github.pagehelper.Page;
public interface TabHaobanMaterialMapper {
int deleteByPrimaryKey(String materialId);
int insert(TabHaobanMaterial record);
int insertSelective(TabHaobanMaterial record);
TabHaobanMaterial selectByPrimaryKey(String materialId);
int updateByPrimaryKeySelective(TabHaobanMaterial record);
int updateByPrimaryKey(TabHaobanMaterial record);
TabHaobanMaterial listMaterialByCategoryId(String categoryId);
Page<TabHaobanMaterial> listMaterial(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("keyword")String keyword, @Param("categoryId")String categoryId, @Param("materialType")Integer materialType);
}
\ No newline at end of file
package com.gic.haoban.manage.service.entity;
import java.io.Serializable;
import java.util.Date;
public class TabHaobanMaidianDict implements Serializable {
private String dictId;
private String dictName;
private String dictData;
private String dictDescrible;
private String moduleId;
private Date createTime;
private Date updateTime;
private Integer status;
private String operationPerson;
private Integer loginFlag;
private Integer transitFlag;
private String code;
private static final long serialVersionUID = 1L;
public String getDictId() {
return dictId;
}
public void setDictId(String dictId) {
this.dictId = dictId == null ? null : dictId.trim();
}
public String getDictName() {
return dictName;
}
public void setDictName(String dictName) {
this.dictName = dictName == null ? null : dictName.trim();
}
public String getDictData() {
return dictData;
}
public void setDictData(String dictData) {
this.dictData = dictData == null ? null : dictData.trim();
}
public String getDictDescrible() {
return dictDescrible;
}
public void setDictDescrible(String dictDescrible) {
this.dictDescrible = dictDescrible == null ? null : dictDescrible.trim();
}
public String getModuleId() {
return moduleId;
}
public void setModuleId(String moduleId) {
this.moduleId = moduleId == null ? null : moduleId.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getOperationPerson() {
return operationPerson;
}
public void setOperationPerson(String operationPerson) {
this.operationPerson = operationPerson == null ? null : operationPerson.trim();
}
public Integer getLoginFlag() {
return loginFlag;
}
public void setLoginFlag(Integer loginFlag) {
this.loginFlag = loginFlag;
}
public Integer getTransitFlag() {
return transitFlag;
}
public void setTransitFlag(Integer transitFlag) {
this.transitFlag = transitFlag;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code == null ? null : code.trim();
}
}
\ No newline at end of file
package com.gic.haoban.manage.service.entity;
import java.io.Serializable;
import java.util.Date;
public class TabHaobanMaidianDictModule implements Serializable {
private String moduleId;
private String moduleName;
private Date createTime;
private Date updateTime;
private Integer status;
private String operationPerson;
private static final long serialVersionUID = 1L;
public String getModuleId() {
return moduleId;
}
public void setModuleId(String moduleId) {
this.moduleId = moduleId == null ? null : moduleId.trim();
}
public String getModuleName() {
return moduleName;
}
public void setModuleName(String moduleName) {
this.moduleName = moduleName == null ? null : moduleName.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getOperationPerson() {
return operationPerson;
}
public void setOperationPerson(String operationPerson) {
this.operationPerson = operationPerson == null ? null : operationPerson.trim();
}
}
\ No newline at end of file
package com.gic.haoban.manage.service.entity;
import java.io.Serializable;
import java.util.Date;
public class TabHaobanMaterial implements Serializable {
private String materialId;
private String materialTitle;
private Integer materialType;
private String categoryId;
private String materialContent;
private String wxLastUploadTime;
private String mediaId;
private String wxEnterpriseId;
private String staffId;
private String staffName;
private String imgUrl;
private String materialDesc;
private Integer statusFlag;
private String link;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public String getMaterialId() {
return materialId;
}
public void setMaterialId(String materialId) {
this.materialId = materialId == null ? null : materialId.trim();
}
public String getMaterialTitle() {
return materialTitle;
}
public void setMaterialTitle(String materialTitle) {
this.materialTitle = materialTitle == null ? null : materialTitle.trim();
}
public Integer getMaterialType() {
return materialType;
}
public void setMaterialType(Integer materialType) {
this.materialType = materialType;
}
public String getCategoryId() {
return categoryId;
}
public void setCategoryId(String categoryId) {
this.categoryId = categoryId == null ? null : categoryId.trim();
}
public String getMaterialContent() {
return materialContent;
}
public void setMaterialContent(String materialContent) {
this.materialContent = materialContent == null ? null : materialContent.trim();
}
public String getWxLastUploadTime() {
return wxLastUploadTime;
}
public void setWxLastUploadTime(String wxLastUploadTime) {
this.wxLastUploadTime = wxLastUploadTime == null ? null : wxLastUploadTime.trim();
}
public String getMediaId() {
return mediaId;
}
public void setMediaId(String mediaId) {
this.mediaId = mediaId == null ? null : mediaId.trim();
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId == null ? null : wxEnterpriseId.trim();
}
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId == null ? null : staffId.trim();
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName == null ? null : staffName.trim();
}
public String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl == null ? null : imgUrl.trim();
}
public String getMaterialDesc() {
return materialDesc;
}
public void setMaterialDesc(String materialDesc) {
this.materialDesc = materialDesc == null ? null : materialDesc.trim();
}
public Integer getStatusFlag() {
return statusFlag;
}
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link == null ? null : link.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
package com.gic.haoban.manage.service.entity;
import java.io.Serializable;
import java.util.Date;
public class TabHaobanMaterialCategory implements Serializable {
private String categoryId;
private String categoryName;
private String categoryParentId;
private String wxEnterpriseId;
private Integer statusFlag;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public String getCategoryId() {
return categoryId;
}
public void setCategoryId(String categoryId) {
this.categoryId = categoryId == null ? null : categoryId.trim();
}
public String getCategoryName() {
return categoryName;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName == null ? null : categoryName.trim();
}
public String getCategoryParentId() {
return categoryParentId;
}
public void setCategoryParentId(String categoryParentId) {
this.categoryParentId = categoryParentId == null ? null : categoryParentId.trim();
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId == null ? null : wxEnterpriseId.trim();
}
public Integer getStatusFlag() {
return statusFlag;
}
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
package com.gic.haoban.manage.service.service;
import java.util.List;
import com.gic.haoban.manage.api.dto.MaterialCategoryDTO;
public interface MaterialCategoryService {
MaterialCategoryDTO hasCategoryNameExsit(String categoryName, String categoryParentId);
void insert(MaterialCategoryDTO materialCategoryDTO);
List<MaterialCategoryDTO> listCategory(String wxEnterpriseId);
MaterialCategoryDTO selectMaterialCategoryById(String categoryId);
void editCategory(MaterialCategoryDTO materialCategoryDTO);
}
package com.gic.haoban.manage.service.service;
import java.util.List;
import com.gic.haoban.manage.api.dto.MaterialDTO;
public interface MaterialService {
List<MaterialDTO> listMaterialByCategoryId(String categoryId);
void insertMaterial(MaterialDTO materialDTO);
MaterialDTO selectMaterialById(String materialId);
void edit(MaterialDTO materialDTO);
com.github.pagehelper.Page listMaterial(String wxEnterpriseId, String keyword, String categoryId,
Integer materialType);
}
......@@ -19,5 +19,4 @@ public interface MemberUnionRelatedService {
void update(MemberUnionidRelatedDTO exsitDTO);
void clean(String cid);
}
package com.gic.haoban.manage.service.service.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.MaterialCategoryDTO;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanMaterialCategoryMapper;
import com.gic.haoban.manage.service.entity.TabHaobanMaterialCategory;
import com.gic.haoban.manage.service.service.MaterialCategoryService;
@Service
public class MaterialCategoryServiceImpl implements MaterialCategoryService{
@Autowired
private TabHaobanMaterialCategoryMapper mapper;
@Override
public MaterialCategoryDTO hasCategoryNameExsit(String categoryName, String categoryParentId) {
return EntityUtil.changeEntityByJSON(MaterialCategoryDTO.class, mapper.selectByCategoryNameAndParentId(categoryName,categoryParentId));
}
@Override
public void insert(MaterialCategoryDTO materialCategoryDTO) {
materialCategoryDTO.setCategoryId(StringUtil.randomUUID());
materialCategoryDTO.setCreateTime(new Date());
materialCategoryDTO.setUpdateTime(materialCategoryDTO.getCreateTime());
materialCategoryDTO.setStatusFlag(1);
mapper.insert(EntityUtil.changeEntityByJSON(TabHaobanMaterialCategory.class, materialCategoryDTO));
}
@Override
public List<MaterialCategoryDTO> listCategory(String wxEnterpriseId) {
return EntityUtil.changeEntityListByJSON(MaterialCategoryDTO.class, mapper.listCategory(wxEnterpriseId));
}
@Override
public MaterialCategoryDTO selectMaterialCategoryById(String categoryId) {
return EntityUtil.changeEntityByJSON(MaterialCategoryDTO.class, mapper.selectByPrimaryKey(categoryId));
}
@Override
public void editCategory(MaterialCategoryDTO materialCategoryDTO) {
materialCategoryDTO.setUpdateTime(new Date());
mapper.updateByPrimaryKeySelective(EntityUtil.changeEntityByJSON(TabHaobanMaterialCategory.class, materialCategoryDTO));
}
}
package com.gic.haoban.manage.service.service.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.MaterialDTO;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanMaterialMapper;
import com.gic.haoban.manage.service.entity.TabHaobanMaterial;
import com.gic.haoban.manage.service.service.MaterialService;
import com.github.pagehelper.Page;
@Service
public class MaterialServiceImpl implements MaterialService {
@Autowired
private TabHaobanMaterialMapper mapper;
@Override
public List<MaterialDTO> listMaterialByCategoryId(String categoryId) {
return EntityUtil.changeEntityListByJSON(MaterialDTO.class, mapper.listMaterialByCategoryId(categoryId));
}
@Override
public void insertMaterial(MaterialDTO materialDTO) {
materialDTO.setCreateTime(new Date());
materialDTO.setUpdateTime(materialDTO.getCreateTime());
materialDTO.setStatusFlag(1);
materialDTO.setMaterialId(StringUtil.randomUUID());
mapper.insert(EntityUtil.changeEntityByJSON(TabHaobanMaterial.class, materialDTO));
}
@Override
public MaterialDTO selectMaterialById(String materialId) {
return EntityUtil.changeEntityByJSON(MaterialDTO.class, mapper.selectByPrimaryKey(materialId));
}
@Override
public void edit(MaterialDTO materialDTO) {
materialDTO.setUpdateTime(new Date());
mapper.updateByPrimaryKeySelective(EntityUtil.changeEntityByJSON(TabHaobanMaterial.class, materialDTO));
}
@Override
public Page<TabHaobanMaterial> listMaterial(String wxEnterpriseId, String keyword, String categoryId, Integer materialType) {
return mapper.listMaterial(wxEnterpriseId,keyword,categoryId,materialType);
}
}
......@@ -30,6 +30,9 @@ public class StaffServiceImpl implements StaffService {
@Override
public TabHaobanStaff selectByNationcodeAndPhoneNumber(String wxEnterpriseId,String nationcode, String phoneNumber) {
if(StringUtils.isBlank(phoneNumber)){
return null;
}
return mapper.selectByNationcodeAndPhoneNumber(wxEnterpriseId,nationcode,phoneNumber);
}
......
......@@ -9,6 +9,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.csp.sentinel.util.StringUtil;
import com.alibaba.fastjson.JSONObject;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
......@@ -16,6 +19,7 @@ import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.enums.AppPageType;
import com.gic.haoban.manage.api.service.BindApiService;
import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
......@@ -39,7 +43,7 @@ public class BindApiServiceImpl implements BindApiService {
private StoreService storeService;
@Autowired
private DepartmentApiService departmentApiService;
@Transactional
@Override
public void clerkManagerTranfer(String departmentId, String fromClerkCode,
......@@ -92,12 +96,26 @@ public class BindApiServiceImpl implements BindApiService {
clerkDTO.setHeadImgUrl(StringUtils.isEmpty(staffDTO.getHeadImg())?"":staffDTO.getHeadImg());
clerkService.updateClerk(clerkDTO);
}
//消息推送
if(StringUtils.isNotEmpty(oldStaffDepartmentRelatedDTO.getClerkCode())){
String clerkId = list.get(0).getClerkId();
String storeName = departmentDTO.getDepartmentName();
String staffName = staffDTO.getStaffName();
String clerkCode = oldStaffDepartmentRelatedDTO.getClerkCode();
String content = "【"+staffName+"】:【"+storeName+"】"+staffName+"导购code:"+clerkCode+"已解绑,请重新分配会员!";
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", storeId);
String data = jsonObject.toJSONString();
String pageUrl = staffDepartmentRelatedApiService.getPageUrl(AppPageType.MEMBER_LIST.getCode(), data);
staffDepartmentRelatedApiService.sendSingleMessage(clerkId, "分配会员通知", content, pageUrl);
}
logger.info("===========================》888888888888888");
}
@Transactional
@Override
public void clerkUnbind(String departmentId, String fromClerkCode,
String toStaffId, String manager) {
DepartmentDTO departmentDTO = departmentApiService.selectById(departmentId);
StaffDepartmentRelatedDTO staffDepartmentRelatedDTO = staffDepartmentRelatedApiService.getOneByStaffIdAndDepartmentId(toStaffId, departmentId);
String oldClerkCode = staffDepartmentRelatedDTO.getClerkCode();
if("1".equals(manager)){
......@@ -116,11 +134,11 @@ public class BindApiServiceImpl implements BindApiService {
dto.setUpdateTime(new Date());
staffDepartmentRelatedApiService.updateById(dto);
//更新gic数据
DepartmentDTO departmentDTO = departmentApiService.selectById(departmentId);
String storeId = departmentDTO.getRelatedId();
List<String> clerkCodes = new ArrayList<>();
clerkCodes.add(fromClerkCode);
List<ClerkDTO> list = clerkService.listClerk(storeId, clerkCodes, true);
String clerkName = CollectionUtil.isEmpty(list)?null:list.get(0).getClerkName();//获取姓名,发消息用
StaffDTO staffDTO = staffApiService.selectById(toStaffId);
for(ClerkDTO clerkDTO :list){
clerkDTO.setPhoneNumber(staffDTO.getPhoneNumber());
......@@ -138,6 +156,24 @@ public class BindApiServiceImpl implements BindApiService {
clerkDTO.setHeadImgUrl("");
clerkService.updateClerk(clerkDTO);
}
//发送消息
if(StringUtil.isNotBlank(fromClerkCode)){
//发送消息
ClerkDTO leader = clerkService.getClerkLeaderByStoreId(storeId);
String clerkId = leader.getClerkId();
String storeName = departmentDTO.getDepartmentName();
String staffName = clerkName;
String leaderName = leader.getClerkName();
String clerkCode = fromClerkCode;
String content = "【"+leaderName+"】:【"+storeName+"】"+staffName+"导购code:"+clerkCode+"已解绑,请重新分配会员!";
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", storeId);
String data = jsonObject.toJSONString();
String pageUrl = staffDepartmentRelatedApiService.getPageUrl(AppPageType.MEMBER_LIST.getCode(), data);
staffDepartmentRelatedApiService.sendSingleMessage(clerkId, "分配会员通知", content, pageUrl);
}
}else{
//把别人的的clerkCode置空
......@@ -158,7 +194,6 @@ public class BindApiServiceImpl implements BindApiService {
dto.setUpdateTime(new Date());
staffDepartmentRelatedApiService.updateById(dto);
//更新gic数据
DepartmentDTO departmentDTO = departmentApiService.selectById(departmentId);
String storeId = departmentDTO.getRelatedId();
List<String> clerkCodes = new ArrayList<>();
clerkCodes.add(fromClerkCode);
......@@ -184,6 +219,25 @@ public class BindApiServiceImpl implements BindApiService {
clerkDTO.setHeadImgUrl("");
clerkService.updateClerk(clerkDTO);
}
//发送消息
if(StringUtil.isNotBlank(dto.getClerkCode())){
//发送消息
ClerkDTO leader = clerkService.getClerkLeaderByStoreId(storeId);
String clerkId = leader.getClerkId();
String storeName = departmentDTO.getDepartmentName();
String staffName = staffDTO.getStaffName();
String leaderName = leader.getClerkName();
String clerkCode = dto.getClerkCode();
String content = "【"+leaderName+"】:【"+storeName+"】"+staffName+"导购code:"+clerkCode+"已解绑,请重新分配会员!";
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", storeId);
String data = jsonObject.toJSONString();
String pageUrl = staffDepartmentRelatedApiService.getPageUrl(AppPageType.MEMBER_LIST.getCode(), data);
staffDepartmentRelatedApiService.sendSingleMessage(clerkId, "分配会员通知", content, pageUrl);
}
}
}
@Transactional
......@@ -203,12 +257,29 @@ public class BindApiServiceImpl implements BindApiService {
List<String> clerkCodes = new ArrayList<>();
clerkCodes.add(fromClerkCode);
List<ClerkDTO> list = clerkService.listClerk(storeId, clerkCodes, true);
String clerkName = CollectionUtil.isEmpty(list)?null:list.get(0).getClerkName();//获取姓名,发消息用
for(ClerkDTO clerkDTO :list){
clerkDTO.setPhoneNumber("--");
clerkDTO.setClerkName(clerkDTO.getClerkName()+"(已解绑)");
clerkDTO.setHeadImgUrl("");
clerkService.updateClerk(clerkDTO);
}
}
//发送消息
if(StringUtil.isNotBlank(fromClerkCode)){
//发送消息
ClerkDTO leader = clerkService.getClerkLeaderByStoreId(storeId);
String clerkId = leader.getClerkId();
String storeName = departmentDTO.getDepartmentName();
String staffName = clerkName;
String leaderName = leader.getClerkName();
String clerkCode = fromClerkCode;
String content = "【"+leaderName+"】:【"+storeName+"】"+staffName+"导购code:"+clerkCode+"已解绑,请重新分配会员!";
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", storeId);
String data = jsonObject.toJSONString();
String pageUrl = staffDepartmentRelatedApiService.getPageUrl(AppPageType.MEMBER_LIST.getCode(), data);
staffDepartmentRelatedApiService.sendSingleMessage(clerkId, "分配会员通知", content, pageUrl);
}
}
@Transactional
@Override
......@@ -245,6 +316,7 @@ public class BindApiServiceImpl implements BindApiService {
List<String> clerkCodes = new ArrayList<>();
clerkCodes.add(fromClerkCode);
List<ClerkDTO> list = clerkService.listClerk(storeId, clerkCodes, true);
String clerkName = CollectionUtil.isEmpty(list)?null:list.get(0).getClerkName();//获取姓名,发消息用
StaffDepartmentRelatedDTO staffDepartmentRelatedDTO = staffDepartmentRelatedApiService.getByStaffDepartmentRelatedId(fromStaffDepartmentRelatedId);
StaffDTO staffDTO = staffApiService.selectById(staffDepartmentRelatedDTO.getStaffId());
for(ClerkDTO clerkDTO :list){
......@@ -252,7 +324,24 @@ public class BindApiServiceImpl implements BindApiService {
clerkDTO.setClerkName(staffDTO.getStaffName());
clerkDTO.setHeadImgUrl(StringUtils.isEmpty(staffDTO.getHeadImg())?"":staffDTO.getHeadImg());
clerkService.updateClerk(clerkDTO);
}
}
//发送消息
if(StringUtil.isNotBlank(fromClerkCode)){
//发送消息
ClerkDTO leader = clerkService.getClerkLeaderByStoreId(storeId);
String clerkId = leader.getClerkId();
String storeName = departmentDTO.getDepartmentName();
String staffName = clerkName;
String leaderName = leader.getClerkName();
String clerkCode = fromClerkCode;
String content = "【"+leaderName+"】:【"+storeName+"】"+staffName+"导购code:"+clerkCode+"已解绑,请重新分配会员!";
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", storeId);
String data = jsonObject.toJSONString();
String pageUrl = staffDepartmentRelatedApiService.getPageUrl(AppPageType.MEMBER_LIST.getCode(), data);
staffDepartmentRelatedApiService.sendSingleMessage(clerkId, "分配会员通知", content, pageUrl);
}
}
......
package com.gic.haoban.manage.service.service.out.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.csp.sentinel.util.StringUtil;
import com.gic.commons.util.EntityUtil;
import com.gic.haoban.common.utils.UuidUtil;
import com.gic.haoban.manage.api.dto.MaidianDictDTO;
import com.gic.haoban.manage.api.dto.MaidianDictModuleDTO;
import com.gic.haoban.manage.api.dto.MaidianDictPageDTO;
import com.gic.haoban.manage.api.service.MaidianDictApiService;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanMaidianDictMapper;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanMaidianDictModuleMapper;
import com.gic.haoban.manage.service.entity.TabHaobanMaidianDict;
import com.gic.haoban.manage.service.entity.TabHaobanMaidianDictModule;
import java.util.Date;
import java.util.List;
/**
* Created by tgs on 2020/2/9.
*/
@Service
public class MaidianDictApiServiceImpl implements MaidianDictApiService{
@Autowired
private TabHaobanMaidianDictMapper tabHaobanMaidianDictMapper;
@Autowired
private TabHaobanMaidianDictModuleMapper tabHaobanMaidianDictModuleMapper;
@Override
public void saveModule(MaidianDictModuleDTO dto) {
TabHaobanMaidianDictModule tab = EntityUtil.changeEntityByJSON(TabHaobanMaidianDictModule.class, dto);
if(StringUtil.isEmpty(tab.getModuleId())){
//新增
tab.setCreateTime(new Date());
tab.setUpdateTime(new Date());
tab.setStatus(1);
tab.setModuleId(UuidUtil.randomUUID());
tabHaobanMaidianDictModuleMapper.insert(tab);
}else{
//更新
tab.setUpdateTime(new Date());
tabHaobanMaidianDictModuleMapper.updateByPrimaryKey(tab);
}
}
@Override
public void savePage(MaidianDictDTO dto) {
TabHaobanMaidianDict tab = EntityUtil.changeEntityByJSON(TabHaobanMaidianDict.class, dto);
if(StringUtil.isEmpty(tab.getDictId())){
//新增
tab.setCreateTime(new Date());
tab.setUpdateTime(new Date());
tab.setStatus(1);
tab.setModuleId(UuidUtil.randomUUID());
tabHaobanMaidianDictMapper.insert(tab);
}else{
//更新
tab.setUpdateTime(new Date());
tabHaobanMaidianDictMapper.updateByPrimaryKey(tab);
}
}
@Override
public void delPage(String dictId) {
tabHaobanMaidianDictMapper.deleteByPrimaryKey(dictId);
}
@Override
public void delModule(String moduleId) {
tabHaobanMaidianDictModuleMapper.deleteByPrimaryKey(moduleId);
}
@Override
public List<MaidianDictPageDTO> dictPage() {
List<TabHaobanMaidianDictModule> list = tabHaobanMaidianDictModuleMapper.list();
List<MaidianDictPageDTO> result = EntityUtil.changeEntityListByJSON(MaidianDictPageDTO.class, list);
if(CollectionUtil.isEmpty(result)){
return result;
}
for(MaidianDictPageDTO dto :result){
String moduleId = dto.getModuleId();
List<TabHaobanMaidianDict> dictList = tabHaobanMaidianDictMapper.listByModuleId(moduleId);
List<MaidianDictDTO> subList = EntityUtil.changeEntityListByJSON(MaidianDictDTO.class, dictList);
dto.setPageList(subList);
}
return result;
}
}
package com.gic.haoban.manage.service.service.out.impl;
import java.io.InputStream;
import java.net.URL;
import java.util.List;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.JSONResponse;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.GlobalInfo;
import com.gic.commons.util.GlobalVar;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.MaterialCategoryDTO;
import com.gic.haoban.manage.api.dto.MaterialDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.service.MaterialApiService;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.service.MaterialCategoryService;
import com.gic.haoban.manage.service.service.MaterialService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.thirdparty.api.dto.PicUploadResDTO;
import com.gic.wechat.api.enums.QywxMediaTypeEnum;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.github.pagehelper.PageHelper;
@Service
public class MaterialApiServiceImpl implements MaterialApiService {
@Autowired
private MaterialCategoryService materialCategoryService;
@Autowired
private MaterialService materialService;
@Autowired
private QywxSuiteApiService qywxSuiteApiService;
@Autowired
private WxEnterpriseService wxEnterpriseService;
@Autowired
private Config config;
private static Logger logger = LoggerFactory.getLogger(MaterialApiServiceImpl.class);
@Override
public boolean hasCategoryNameExsit(String categoryName, String categoryParentId,String categoryId) {
MaterialCategoryDTO category = materialCategoryService.hasCategoryNameExsit(categoryName,categoryParentId);
if(category != null){
if(category.getCategoryId().equals(categoryId)){
return false;
}
else{
return true;
}
}
return false;
}
@Override
public void insertCategory(MaterialCategoryDTO materialCategoryDTO) {
materialCategoryService.insert(materialCategoryDTO);
}
@Override
public List<MaterialCategoryDTO> listCategory(String wxEnterpriseId) {
return materialCategoryService.listCategory(wxEnterpriseId);
}
@Override
public MaterialCategoryDTO selectMaterialCategoryById(String categoryId) {
return materialCategoryService.selectMaterialCategoryById(categoryId);
}
@Override
public void editCategory(MaterialCategoryDTO materialCategoryDTO) {
materialCategoryService.editCategory(materialCategoryDTO);
}
@Override
public List<MaterialDTO> listMaterialByCategoryId(String categoryId) {
return materialService.listMaterialByCategoryId(categoryId);
}
@Override
public void insertMaterial(MaterialDTO materialDTO) {
Integer type = materialDTO.getMaterialType();
String wxEnterpriseId = materialDTO.getWxEnterpriseId();
WxEnterpriseDTO enterprise = wxEnterpriseService.selectById(wxEnterpriseId);
if(type == null){
return;
}
if(enterprise == null){
return;
}
QywxMediaTypeEnum fileType = null;
String url = "";
if(type == 2){
fileType = QywxMediaTypeEnum.IMAGE;
url = materialDTO.getImgUrl();
}
if(type == 4){
fileType = QywxMediaTypeEnum.VIDEO;
url = materialDTO.getLink();
}
if(type == 5){
fileType = QywxMediaTypeEnum.FILE;
url = materialDTO.getLink();
}
if(fileType != null){
JSONResponse jp = qywxSuiteApiService.uploadMedia(enterprise.getCorpid(), config.getWxSuiteid(), getFileByte(url), fileType.getCode());
if(jp.getErrorCode() == 0){
materialDTO.setMediaId(jp.getResult().toString());
materialService.insertMaterial(materialDTO);
}
}else{
materialService.insertMaterial(materialDTO);
}
}
@Override
public MaterialDTO selectMaterialById(String materialId) {
return materialService.selectMaterialById(materialId);
}
@Override
public void editMaterial(MaterialDTO materialDTO) {
Integer type = materialDTO.getMaterialType();
String materialId = materialDTO.getMaterialId();
MaterialDTO old = materialService.selectMaterialById(materialId);
String wxEnterpriseId = old.getWxEnterpriseId();
WxEnterpriseDTO enterprise = wxEnterpriseService.selectById(wxEnterpriseId);
if(type == null){
return;
}
if(enterprise == null){
return;
}
QywxMediaTypeEnum fileType = null;
String url = "";
String oldUrl = "";
if(type == 2){
fileType = QywxMediaTypeEnum.IMAGE;
url = materialDTO.getImgUrl();
oldUrl = old.getImgUrl();
}
if(type == 4){
fileType = QywxMediaTypeEnum.VIDEO;
url = materialDTO.getLink();
oldUrl = old.getLink();
}
if(type == 5){
fileType = QywxMediaTypeEnum.FILE;
url = materialDTO.getLink();
oldUrl = old.getLink();
}
if(fileType != null && !url.equals(oldUrl)){
JSONResponse jp = qywxSuiteApiService.uploadMedia(enterprise.getCorpid(), config.getWxSuiteid(), getFileByte(url), fileType.getCode());
if(jp.getErrorCode() == 0){
materialDTO.setMediaId(jp.getResult().toString());
materialService.edit(materialDTO);
}
}else{
materialService.edit(materialDTO);
}
}
@Override
public Page<MaterialDTO> listMaterial(String wxEnterpriseId, String keyword, String categoryId,
Integer materialType,BasePageInfo pageInfo) {
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
return PageUtil.changePageHelperToCurrentPage(materialService.listMaterial(wxEnterpriseId,keyword,categoryId,materialType),MaterialDTO.class);
}
private byte[] getFileByte(String url) {
try {
InputStream in = new URL(url).openStream();
byte[] data = IOUtils.toByteArray(in);
return data;
}catch (Exception e){
}
return null;
}
}
......@@ -10,6 +10,7 @@ import com.gic.wechat.api.service.qywx.QywxUserApiService;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
......@@ -21,6 +22,7 @@ import org.springframework.stereotype.Service;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.MD5Utils;
import com.gic.commons.util.Md5Util;
import com.gic.commons.util.StringUtil;
......@@ -105,7 +107,6 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
private ClerkMainStoreRelatedService clerkMainStoreRelatedService;
@Autowired
private StoreService storeService;
@Autowired
private Config config;
......@@ -614,6 +615,12 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
return list;
}
@Override
public List<MemberUnionidRelatedDTO> listByWxEnterpriseIdAndDate( String wxEnterpriseId,Date date) {
List<MemberUnionidRelated> list = memberUnionidRelatedMapper.listByWxEnterpriseIdAndDate(wxEnterpriseId,date);
return EntityUtil.changeEntityListByJSON(MemberUnionidRelatedDTO.class,list);
}
@Override
public void freshWxFrend(String wxEnterpriseId, String wxUserId) {
log.info("【刷下好友】wxUserId={}",wxUserId);
WxEnterpriseDTO enterprise = wxEnterpriseService.selectById(wxEnterpriseId);
......
......@@ -21,6 +21,7 @@ import com.gic.redis.data.anno.RedisCache;
import com.gic.thirdparty.api.dto.PicUploadResDTO;
import com.gic.thirdparty.api.service.QQCloudPicService;
import com.vdurmont.emoji.EmojiParser;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
......@@ -780,6 +781,10 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
if(StringUtils.isBlank(clerkMid.getPhoneNumber()) || "--".equals(clerkMid.getPhoneNumber())){
return;
}
if(wxEnterpriseRelatedApiService.enterpriseUseNew(clerkMid.getEnterpriseId())){
try {
addClerkByGic(clerkMid);
......@@ -1216,6 +1221,11 @@ public class StaffApiServiceImpl implements StaffApiService {
}
return resp;
}
@Override
public List<StaffDTO> listByWxUserId(String wxUserId) {
List<TabHaobanStaff> list = staffMapper.listByWxUserId(wxUserId);
return EntityUtil.changeEntityListByJSON(StaffDTO.class, list);
}
// private String getMobile(String phoneNumber,String nationcode){
// String mobile = nationcode + phoneNumber;
......
......@@ -39,6 +39,8 @@
<dubbo:service interface="com.gic.haoban.manage.api.service.AuditApiService" ref="auditApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.ClerkMainStoreRelatedApiService" ref="clerkMainStoreRelatedApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.MaidianLogApiService" ref="maidianLogApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.MaidianDictApiService" ref="maidianDictApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.MaterialApiService" ref="materialApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.DealSyncOperationApiService"
ref="dealSyncOperationApiServiceImpl" timeout="10000"/>
......
......@@ -220,6 +220,17 @@
and status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
</select>
<select id="listByWxEnterpriseIdAndDate" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_member_unionid_related
where status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
<if test="date != null" >
and TO_DAYS(create_time) <![CDATA[ >= ]]> TO_DAYS(#{date,jdbcType=TIMESTAMP})
</if>
</select>
<select id="listByExTernalUseridAndWxUserId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
......
......@@ -299,7 +299,6 @@
#{id,jdbcType=VARCHAR}
</foreach>
and status_flag = 1
group by staff_id
</select>
</mapper>
\ No newline at end of file
......@@ -291,6 +291,15 @@
</foreach>
</if>
</select>
<select id="listByWxUserId" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff
where status_flag = 1
<if test="wxUserId != null">
and wx_user_id = #{wxUserId,jdbcType=VARCHAR}
</if>
</select>
<select id="listLikeName" resultMap="BaseResultMap" >
select
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.gic.haoban.manage.service.dao.mapper.TabHaobanMaidianDictMapper" >
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanMaidianDict" >
<id column="dict_id" property="dictId" jdbcType="VARCHAR" />
<result column="dict_name" property="dictName" jdbcType="VARCHAR" />
<result column="dict_data" property="dictData" jdbcType="VARCHAR" />
<result column="dict_describle" property="dictDescrible" jdbcType="VARCHAR" />
<result column="module_id" property="moduleId" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="status" property="status" jdbcType="INTEGER" />
<result column="operation_person" property="operationPerson" jdbcType="VARCHAR" />
<result column="login_flag" property="loginFlag" jdbcType="INTEGER" />
<result column="transit_flag" property="transitFlag" jdbcType="INTEGER" />
<result column="code" property="code" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
dict_id, dict_name, dict_data, dict_describle, module_id, create_time, update_time,
status, operation_person, login_flag, transit_flag, code
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_maidian_dict
where dict_id = #{dictId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from tab_haoban_maidian_dict
where dict_id = #{dictId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanMaidianDict" >
insert into tab_haoban_maidian_dict (dict_id, dict_name, dict_data,
dict_describle, module_id, create_time,
update_time, status, operation_person,
login_flag, transit_flag, code
)
values (#{dictId,jdbcType=VARCHAR}, #{dictName,jdbcType=VARCHAR}, #{dictData,jdbcType=VARCHAR},
#{dictDescrible,jdbcType=VARCHAR}, #{moduleId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, #{operationPerson,jdbcType=VARCHAR},
#{loginFlag,jdbcType=INTEGER}, #{transitFlag,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanMaidianDict" >
insert into tab_haoban_maidian_dict
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="dictId != null" >
dict_id,
</if>
<if test="dictName != null" >
dict_name,
</if>
<if test="dictData != null" >
dict_data,
</if>
<if test="dictDescrible != null" >
dict_describle,
</if>
<if test="moduleId != null" >
module_id,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="updateTime != null" >
update_time,
</if>
<if test="status != null" >
status,
</if>
<if test="operationPerson != null" >
operation_person,
</if>
<if test="loginFlag != null" >
login_flag,
</if>
<if test="transitFlag != null" >
transit_flag,
</if>
<if test="code != null" >
code,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="dictId != null" >
#{dictId,jdbcType=VARCHAR},
</if>
<if test="dictName != null" >
#{dictName,jdbcType=VARCHAR},
</if>
<if test="dictData != null" >
#{dictData,jdbcType=VARCHAR},
</if>
<if test="dictDescrible != null" >
#{dictDescrible,jdbcType=VARCHAR},
</if>
<if test="moduleId != null" >
#{moduleId,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null" >
#{status,jdbcType=INTEGER},
</if>
<if test="operationPerson != null" >
#{operationPerson,jdbcType=VARCHAR},
</if>
<if test="loginFlag != null" >
#{loginFlag,jdbcType=INTEGER},
</if>
<if test="transitFlag != null" >
#{transitFlag,jdbcType=INTEGER},
</if>
<if test="code != null" >
#{code,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanMaidianDict" >
update tab_haoban_maidian_dict
<set >
<if test="dictName != null" >
dict_name = #{dictName,jdbcType=VARCHAR},
</if>
<if test="dictData != null" >
dict_data = #{dictData,jdbcType=VARCHAR},
</if>
<if test="dictDescrible != null" >
dict_describle = #{dictDescrible,jdbcType=VARCHAR},
</if>
<if test="moduleId != null" >
module_id = #{moduleId,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null" >
status = #{status,jdbcType=INTEGER},
</if>
<if test="operationPerson != null" >
operation_person = #{operationPerson,jdbcType=VARCHAR},
</if>
<if test="loginFlag != null" >
login_flag = #{loginFlag,jdbcType=INTEGER},
</if>
<if test="transitFlag != null" >
transit_flag = #{transitFlag,jdbcType=INTEGER},
</if>
<if test="code != null" >
code = #{code,jdbcType=VARCHAR},
</if>
</set>
where dict_id = #{dictId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanMaidianDict" >
update tab_haoban_maidian_dict
set dict_name = #{dictName,jdbcType=VARCHAR},
dict_data = #{dictData,jdbcType=VARCHAR},
dict_describle = #{dictDescrible,jdbcType=VARCHAR},
module_id = #{moduleId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER},
operation_person = #{operationPerson,jdbcType=VARCHAR},
login_flag = #{loginFlag,jdbcType=INTEGER},
transit_flag = #{transitFlag,jdbcType=INTEGER},
code = #{code,jdbcType=VARCHAR}
where dict_id = #{dictId,jdbcType=VARCHAR}
</update>
<select id="listByModuleId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_maidian_dict
where module_id = #{moduleId,jdbcType=VARCHAR}
and status = 1
order by create_time
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.gic.haoban.manage.service.dao.mapper.TabHaobanMaidianDictModuleMapper" >
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanMaidianDictModule" >
<id column="module_id" property="moduleId" jdbcType="VARCHAR" />
<result column="module_name" property="moduleName" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="status" property="status" jdbcType="INTEGER" />
<result column="operation_person" property="operationPerson" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
module_id, module_name, create_time, update_time, status, operation_person
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_maidian_dict_module
where module_id = #{moduleId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from tab_haoban_maidian_dict_module
where module_id = #{moduleId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanMaidianDictModule" >
insert into tab_haoban_maidian_dict_module (module_id, module_name, create_time,
update_time, status, operation_person
)
values (#{moduleId,jdbcType=VARCHAR}, #{moduleName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, #{operationPerson,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanMaidianDictModule" >
insert into tab_haoban_maidian_dict_module
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="moduleId != null" >
module_id,
</if>
<if test="moduleName != null" >
module_name,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="updateTime != null" >
update_time,
</if>
<if test="status != null" >
status,
</if>
<if test="operationPerson != null" >
operation_person,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="moduleId != null" >
#{moduleId,jdbcType=VARCHAR},
</if>
<if test="moduleName != null" >
#{moduleName,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null" >
#{status,jdbcType=INTEGER},
</if>
<if test="operationPerson != null" >
#{operationPerson,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanMaidianDictModule" >
update tab_haoban_maidian_dict_module
<set >
<if test="moduleName != null" >
module_name = #{moduleName,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null" >
status = #{status,jdbcType=INTEGER},
</if>
<if test="operationPerson != null" >
operation_person = #{operationPerson,jdbcType=VARCHAR},
</if>
</set>
where module_id = #{moduleId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanMaidianDictModule" >
update tab_haoban_maidian_dict_module
set module_name = #{moduleName,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER},
operation_person = #{operationPerson,jdbcType=VARCHAR}
where module_id = #{moduleId,jdbcType=VARCHAR}
</update>
<select id="list" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_maidian_dict_module
where status =1
order by create_time
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.gic.haoban.manage.service.dao.mapper.TabHaobanMaterialCategoryMapper" >
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanMaterialCategory" >
<id column="category_id" property="categoryId" jdbcType="VARCHAR" />
<result column="category_name" property="categoryName" jdbcType="VARCHAR" />
<result column="category_parent_id" property="categoryParentId" jdbcType="VARCHAR" />
<result column="wx_enterprise_id" property="wxEnterpriseId" jdbcType="VARCHAR" />
<result column="status_flag" property="statusFlag" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
category_id, category_name, category_parent_id, wx_enterprise_id, status_flag, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_material_category
where category_id = #{categoryId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from tab_haoban_material_category
where category_id = #{categoryId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanMaterialCategory" >
insert into tab_haoban_material_category (category_id, category_name, category_parent_id,
wx_enterprise_id, status_flag, create_time,
update_time)
values (#{categoryId,jdbcType=VARCHAR}, #{categoryName,jdbcType=VARCHAR}, #{categoryParentId,jdbcType=VARCHAR},
#{wxEnterpriseId,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanMaterialCategory" >
insert into tab_haoban_material_category
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="categoryId != null" >
category_id,
</if>
<if test="categoryName != null" >
category_name,
</if>
<if test="categoryParentId != null" >
category_parent_id,
</if>
<if test="wxEnterpriseId != null" >
wx_enterprise_id,
</if>
<if test="statusFlag != null" >
status_flag,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="updateTime != null" >
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="categoryId != null" >
#{categoryId,jdbcType=VARCHAR},
</if>
<if test="categoryName != null" >
#{categoryName,jdbcType=VARCHAR},
</if>
<if test="categoryParentId != null" >
#{categoryParentId,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseId != null" >
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null" >
#{statusFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanMaterialCategory" >
update tab_haoban_material_category
<set >
<if test="categoryName != null" >
category_name = #{categoryName,jdbcType=VARCHAR},
</if>
<if test="categoryParentId != null" >
category_parent_id = #{categoryParentId,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseId != null" >
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null" >
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where category_id = #{categoryId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanMaterialCategory" >
update tab_haoban_material_category
set category_name = #{categoryName,jdbcType=VARCHAR},
category_parent_id = #{categoryParentId,jdbcType=VARCHAR},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where category_id = #{categoryId,jdbcType=VARCHAR}
</update>
<select id="selectByCategoryNameAndParentId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_material_category
where category_name = #{categoryName,jdbcType=VARCHAR}
and status_flag = 1
and category_parent_id = #{categoryParentId}
</select>
<select id="listCategory" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_material_category
where status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.gic.haoban.manage.service.dao.mapper.TabHaobanMaterialMapper" >
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanMaterial" >
<id column="material_id" property="materialId" jdbcType="VARCHAR" />
<result column="material_title" property="materialTitle" jdbcType="VARCHAR" />
<result column="material_type" property="materialType" jdbcType="INTEGER" />
<result column="category_id" property="categoryId" jdbcType="VARCHAR" />
<result column="material_content" property="materialContent" jdbcType="VARCHAR" />
<result column="wx_last_upload_time" property="wxLastUploadTime" jdbcType="VARCHAR" />
<result column="media_id" property="mediaId" jdbcType="VARCHAR" />
<result column="wx_enterprise_id" property="wxEnterpriseId" jdbcType="VARCHAR" />
<result column="staff_id" property="staffId" jdbcType="VARCHAR" />
<result column="staff_name" property="staffName" jdbcType="VARCHAR" />
<result column="img_url" property="imgUrl" jdbcType="VARCHAR" />
<result column="material_desc" property="materialDesc" jdbcType="VARCHAR" />
<result column="status_flag" property="statusFlag" jdbcType="INTEGER" />
<result column="link" property="link" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
material_id, material_title, material_type, category_id, material_content, wx_last_upload_time,
media_id, wx_enterprise_id, staff_id, staff_name, img_url, material_desc, status_flag,
link, create_time, update_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_material
where material_id = #{materialId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from tab_haoban_material
where material_id = #{materialId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanMaterial" >
insert into tab_haoban_material (material_id, material_title, material_type,
category_id, material_content, wx_last_upload_time,
media_id, wx_enterprise_id, staff_id,
staff_name, img_url, material_desc,
status_flag, link, create_time,
update_time)
values (#{materialId,jdbcType=VARCHAR}, #{materialTitle,jdbcType=VARCHAR}, #{materialType,jdbcType=INTEGER},
#{categoryId,jdbcType=VARCHAR}, #{materialContent,jdbcType=VARCHAR}, #{wxLastUploadTime,jdbcType=VARCHAR},
#{mediaId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{staffId,jdbcType=VARCHAR},
#{staffName,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR}, #{materialDesc,jdbcType=VARCHAR},
#{statusFlag,jdbcType=INTEGER}, #{link,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanMaterial" >
insert into tab_haoban_material
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="materialId != null" >
material_id,
</if>
<if test="materialTitle != null" >
material_title,
</if>
<if test="materialType != null" >
material_type,
</if>
<if test="categoryId != null" >
category_id,
</if>
<if test="materialContent != null" >
material_content,
</if>
<if test="wxLastUploadTime != null" >
wx_last_upload_time,
</if>
<if test="mediaId != null" >
media_id,
</if>
<if test="wxEnterpriseId != null" >
wx_enterprise_id,
</if>
<if test="staffId != null" >
staff_id,
</if>
<if test="staffName != null" >
staff_name,
</if>
<if test="imgUrl != null" >
img_url,
</if>
<if test="materialDesc != null" >
material_desc,
</if>
<if test="statusFlag != null" >
status_flag,
</if>
<if test="link != null" >
link,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="updateTime != null" >
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="materialId != null" >
#{materialId,jdbcType=VARCHAR},
</if>
<if test="materialTitle != null" >
#{materialTitle,jdbcType=VARCHAR},
</if>
<if test="materialType != null" >
#{materialType,jdbcType=INTEGER},
</if>
<if test="categoryId != null" >
#{categoryId,jdbcType=VARCHAR},
</if>
<if test="materialContent != null" >
#{materialContent,jdbcType=VARCHAR},
</if>
<if test="wxLastUploadTime != null" >
#{wxLastUploadTime,jdbcType=VARCHAR},
</if>
<if test="mediaId != null" >
#{mediaId,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseId != null" >
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="staffId != null" >
#{staffId,jdbcType=VARCHAR},
</if>
<if test="staffName != null" >
#{staffName,jdbcType=VARCHAR},
</if>
<if test="imgUrl != null" >
#{imgUrl,jdbcType=VARCHAR},
</if>
<if test="materialDesc != null" >
#{materialDesc,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null" >
#{statusFlag,jdbcType=INTEGER},
</if>
<if test="link != null" >
#{link,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanMaterial" >
update tab_haoban_material
<set >
<if test="materialTitle != null" >
material_title = #{materialTitle,jdbcType=VARCHAR},
</if>
<if test="materialType != null" >
material_type = #{materialType,jdbcType=INTEGER},
</if>
<if test="categoryId != null" >
category_id = #{categoryId,jdbcType=VARCHAR},
</if>
<if test="materialContent != null" >
material_content = #{materialContent,jdbcType=VARCHAR},
</if>
<if test="wxLastUploadTime != null" >
wx_last_upload_time = #{wxLastUploadTime,jdbcType=VARCHAR},
</if>
<if test="mediaId != null" >
media_id = #{mediaId,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseId != null" >
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="staffId != null" >
staff_id = #{staffId,jdbcType=VARCHAR},
</if>
<if test="staffName != null" >
staff_name = #{staffName,jdbcType=VARCHAR},
</if>
<if test="imgUrl != null" >
img_url = #{imgUrl,jdbcType=VARCHAR},
</if>
<if test="materialDesc != null" >
material_desc = #{materialDesc,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null" >
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
<if test="link != null" >
link = #{link,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where material_id = #{materialId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanMaterial" >
update tab_haoban_material
set material_title = #{materialTitle,jdbcType=VARCHAR},
material_type = #{materialType,jdbcType=INTEGER},
category_id = #{categoryId,jdbcType=VARCHAR},
material_content = #{materialContent,jdbcType=VARCHAR},
wx_last_upload_time = #{wxLastUploadTime,jdbcType=VARCHAR},
media_id = #{mediaId,jdbcType=VARCHAR},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
staff_id = #{staffId,jdbcType=VARCHAR},
staff_name = #{staffName,jdbcType=VARCHAR},
img_url = #{imgUrl,jdbcType=VARCHAR},
material_desc = #{materialDesc,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER},
link = #{link,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where material_id = #{materialId,jdbcType=VARCHAR}
</update>
<select id="listMaterialByCategoryId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_material
where category_id = #{categoryId,jdbcType=VARCHAR}
and status_flag = 1
</select>
<select id="listMaterial" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from tab_haoban_material
where status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
</select>
</mapper>
\ No newline at end of file
......@@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RestController;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.csp.sentinel.util.StringUtil;
import com.alibaba.fastjson.JSONObject;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.EntityUtil;
......@@ -19,6 +21,7 @@ import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.enums.AppPageType;
import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
......@@ -93,7 +96,7 @@ public class ClerkController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_2);
}
StaffDepartmentRelatedDTO staffDepartmentRelatedDTO = staffDepartmentRelatedApiService.getByStaffDepartmentRelatedId(fromStaffDepartmentRelatedId);
String oldClerkCode = staffDepartmentRelatedDTO.getClerkCode();
//将指定人绑定clerkCode
StaffDepartmentRelatedDTO dto = new StaffDepartmentRelatedDTO();
dto.setStaffDepartmentRelatedId(fromStaffDepartmentRelatedId);
......@@ -125,6 +128,23 @@ public class ClerkController extends WebBaseController{
clerkService.updateClerk(clerkDTO);
}
}
//发送消息
if(StringUtil.isNotBlank(oldClerkCode)){
//发送消息
ClerkDTO leader = clerkService.getClerkLeaderByStoreId(storeId);
String clerkId = leader.getClerkId();
String storeName = departmentDTO.getDepartmentName();
String staffName = staffDTO.getStaffName();
String leaderName = leader.getClerkName();
String clerkCode = oldClerkCode;
String content = "【"+leaderName+"】:【"+storeName+"】"+staffName+"导购code:"+clerkCode+"已解绑,请重新分配会员!";
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", storeId);
String data = jsonObject.toJSONString();
String pageUrl = staffDepartmentRelatedApiService.getPageUrl(AppPageType.MEMBER_LIST.getCode(), data);
staffDepartmentRelatedApiService.sendSingleMessage(clerkId, "分配会员通知", content, pageUrl);
}
return resultResponse(HaoBanErrCode.ERR_1);
}
......
......@@ -439,8 +439,8 @@ public class DepartmentContoller extends WebBaseController{
public void syncDepartment(String editDepartment,String delDepartmentIds,String addDepartment){
if(StringUtils.isNotBlank(addDepartment)) {
List<DepartmentAddQO> list = JSONArray.parseArray(addDepartment, DepartmentAddQO.class);
int sort = 0;
int maxSort = list.size();
long sort = 0;
long maxSort = list.size();
for (DepartmentAddQO departmentAddQO : list) {
String parentId = departmentAddQO.getParentId();
DepartmentDTO dto = departmentApiService.selectById(parentId);
......@@ -494,8 +494,8 @@ public class DepartmentContoller extends WebBaseController{
logger.info("【部门修改】editDepartment={}",editDepartment);
if(StringUtils.isNotBlank(editDepartment)) {
List<DepartmentEditQO> list = JSONArray.parseArray(editDepartment, DepartmentEditQO.class);
int sort = 0;
int maxSort = list.size();
long sort = 0;
long maxSort = list.size();
logger.info("【部门修改】list={}",JSON.toJSONString(list));
for (DepartmentEditQO departmentQO : list) {
String parentId = departmentQO.getParentId();
......@@ -641,8 +641,8 @@ public class DepartmentContoller extends WebBaseController{
logger.info("【处理子节点】sonDepartment={},parentId={}",sonDepartment,parentId);
if(StringUtils.isNotBlank(sonDepartment)) {
List<DepartmentAddQO> list = JSONArray.parseArray(sonDepartment, DepartmentAddQO.class);
int maxSort = list.size();
int sort = 0;
long maxSort = list.size();
long sort = 0;
for (DepartmentAddQO departmentAddQO : list) {
Integer type = departmentAddQO.getType();
Integer isStore = 0;
......
package com.gic.haoban.manage.web.controller;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.MaterialCategoryDTO;
import com.gic.haoban.manage.api.dto.MaterialDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.service.MaterialApiService;
import com.gic.haoban.manage.web.auth.AuthRequestUtil;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.vo.LoginVO;
@RestController
public class MaterialController extends WebBaseController{
@Autowired
private MaterialApiService materialApiService;
/**
* 素材分组新增
* @return
*/
@RequestMapping("/mateial-add-category")
public HaobanResponse materialAddCategory(MaterialCategoryDTO materialCategoryDTO) {
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId();
materialCategoryDTO.setWxEnterpriseId(wxEnterpriseId);
String categoryName = materialCategoryDTO.getCategoryName();
String categoryParentId = materialCategoryDTO.getCategoryParentId();
if(StringUtils.isAnyBlank(categoryParentId,categoryName)){
return resultResponse(HaoBanErrCode.ERR_2);
}
boolean flag = materialApiService.hasCategoryNameExsit(categoryName,categoryParentId,null);
if(flag){
return resultResponse(HaoBanErrCode.ERR_10015);
}
materialApiService.insertCategory(materialCategoryDTO);
return resultResponse(HaoBanErrCode.ERR_1);
}
/**
* 素材分组查询
* @return
*/
@RequestMapping("/category-list")
public HaobanResponse categoryList(String wxEnterpriseId) {
List<MaterialCategoryDTO> list = materialApiService.listCategory(wxEnterpriseId);
return resultResponse(HaoBanErrCode.ERR_1,list);
}
/**
* 素材分组修改
* @return
*/
@RequestMapping("/category-edit")
public HaobanResponse categoryEdit(MaterialCategoryDTO materialCategoryDTO) {
String categoryName = materialCategoryDTO.getCategoryName();
String categoryId = materialCategoryDTO.getCategoryId();
if(StringUtils.isAnyBlank(categoryName,categoryId)){
return resultResponse(HaoBanErrCode.ERR_2);
}
MaterialCategoryDTO dto = materialApiService.selectMaterialCategoryById(categoryId);
if(dto == null){
return resultResponse(HaoBanErrCode.ERR_10016);
}
String categoryParentId = dto.getCategoryParentId();
boolean flag = materialApiService.hasCategoryNameExsit(categoryName,categoryParentId,materialCategoryDTO.getCategoryId());
if(flag){
return resultResponse(HaoBanErrCode.ERR_10015);
}
materialApiService.editCategory(materialCategoryDTO);
return resultResponse(HaoBanErrCode.ERR_1);
}
/**
* 素材分组删除
* @return
*/
@RequestMapping("/category-del")
public HaobanResponse categoryDel(String categoryId) {
MaterialCategoryDTO dto = materialApiService.selectMaterialCategoryById(categoryId);
if(dto == null){
return resultResponse(HaoBanErrCode.ERR_10016);
}
List<MaterialDTO> list = materialApiService.listMaterialByCategoryId(categoryId);
if(!list.isEmpty()){
return resultResponse(HaoBanErrCode.ERR_10017);
}
dto.setStatusFlag(0);
materialApiService.editCategory(dto);
return resultResponse(HaoBanErrCode.ERR_1);
}
/**
* 素材新增
* @return
*/
@RequestMapping("/material-add")
public HaobanResponse materialAdd(MaterialDTO materialDTO) {
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId();
materialDTO.setWxEnterpriseId(wxEnterpriseId);
StaffDTO staff = login.getStaffDTO();
materialDTO.setStaffId(staff.getStaffId());
materialDTO.setStaffName(staff.getStaffName());
String materialTitle = materialDTO.getMaterialTitle();
String categoryId = materialDTO.getCategoryId();
Integer categoryType = materialDTO.getMaterialType();
if(StringUtils.isAnyBlank(categoryId,materialTitle)){
return resultResponse(HaoBanErrCode.ERR_2);
}
if(categoryType == null){
return resultResponse(HaoBanErrCode.ERR_2);
}
materialApiService.insertMaterial(materialDTO);
return resultResponse(HaoBanErrCode.ERR_1);
}
/**
* 素材详情
* @return
*/
@RequestMapping("/material-detail")
public HaobanResponse materialDetail(String materialId) {
MaterialDTO dto = materialApiService.selectMaterialById(materialId);
return resultResponse(HaoBanErrCode.ERR_1,dto);
}
/**
* 素材修改
* @return
*/
@RequestMapping("/material-eidt")
public HaobanResponse materialEdit(MaterialDTO materialDTO) {
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
StaffDTO staff = login.getStaffDTO();
materialDTO.setStaffId(staff.getStaffId());
materialDTO.setStaffName(staff.getStaffName());
String materialId = materialDTO.getMaterialId();
MaterialDTO dto = materialApiService.selectMaterialById(materialId);
if(dto == null){
return resultResponse(HaoBanErrCode.ERR_2);
}
materialApiService.editMaterial(materialDTO);
return resultResponse(HaoBanErrCode.ERR_1);
}
/**
* 素材删除
* @return
*/
@RequestMapping("/material-del")
public HaobanResponse materialEdit(String materialIds) {
if(StringUtils.isBlank(materialIds)){
return resultResponse(HaoBanErrCode.ERR_2);
}
String[] stringArr = materialIds.split(",");
for (String materialId : stringArr) {
MaterialDTO dto = materialApiService.selectMaterialById(materialId);
if(dto == null){
continue;
}
dto.setStatusFlag(0);
materialApiService.editMaterial(dto);
}
return resultResponse(HaoBanErrCode.ERR_1);
}
/**
* 素材查询
* @return
*/
@RequestMapping("/material-list")
public HaobanResponse materialList(String wxEnterpriseId,String keyword,String categoryId,Integer materialType,BasePageInfo pageInfo) {
Page<MaterialDTO> page = materialApiService.listMaterial(wxEnterpriseId,keyword,categoryId,materialType,pageInfo);
return resultResponse(HaoBanErrCode.ERR_1,page);
}
/**
* 素材批量转移
* @return
*/
@RequestMapping("/material-batch")
public HaobanResponse materialBatch(String materialIds,String categoryId) {
String[] stringArr = materialIds.split(",");
for (String materialId : stringArr) {
MaterialDTO dto = materialApiService.selectMaterialById(materialId);
if(dto == null){
continue;
}
dto.setCategoryId(categoryId);;
materialApiService.editMaterial(dto);
}
return resultResponse(HaoBanErrCode.ERR_1);
}
}
......@@ -87,7 +87,16 @@ public enum HaoBanErrCode {
ERR_10014(10014,"暂存部门人员不能删除"),
ERR_10015(10015,"分组已存在"),
ERR_10016(10016,"分组不存在"),
ERR_10017(10017,"存在素材不能删除"),
ERR_10018(10018,"素材不存在"),
ERR_100015(100015,"暂存部门不能删除"),
ERR_DEFINE(-888, "自定义错误"),
ERR_OTHER(-999, "未知错误code");
......
......@@ -20,7 +20,7 @@ public class DepartmentAddQO implements Serializable {
private Boolean addFlag;
private Integer sort;
private Long sort;
private Integer type;
......@@ -59,11 +59,12 @@ public class DepartmentAddQO implements Serializable {
public Integer getSort() {
public Long getSort() {
return sort;
}
public void setSort(Integer sort) {
public void setSort(Long sort) {
this.sort = sort;
}
......
......@@ -51,6 +51,8 @@
<dubbo:reference interface="com.gic.haoban.manage.api.service.AuditSettingApiService" id="auditSettingApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.DictApiService" id="dictApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.HelpApiService" id="helpApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.MaterialApiService" id="materialApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService" id="memberUnionidRelatedApiService"/>
......
package com.gic.haoban.manage.web.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.MaterialCategoryDTO;
import com.gic.haoban.manage.api.dto.MaterialDTO;
import com.gic.haoban.manage.api.service.MaterialApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.vo.MaterialVO;
@RestController
public class MaterialController extends WebBaseController{
@Autowired
private MaterialApiService materialApiService;
/**
* 素材查询
* @return
*/
@RequestMapping("/material-list")
public HaobanResponse materialList(String wxEnterpriseId,String keyword,String categoryId,Integer materialType,BasePageInfo pageInfo) {
Page<MaterialDTO> page = materialApiService.listMaterial(wxEnterpriseId,keyword,categoryId,materialType,pageInfo);
return resultResponse(HaoBanErrCode.ERR_1,page);
}
/**
* 素材查询
* @return
*/
@RequestMapping("/material-type")
public HaobanResponse materialType(String wxEnterpriseId) {
List<MaterialCategoryDTO> list = materialApiService.listCategory(wxEnterpriseId);
List<MaterialVO> handerList = new ArrayList<MaterialVO>();
for (MaterialCategoryDTO materialCategoryDTO : list) {
if("0".equals(materialCategoryDTO.getCategoryParentId())){
handerList.add(EntityUtil.changeEntityByJSON(MaterialVO.class, materialCategoryDTO));
}
}
Map<String,List<MaterialCategoryDTO>> map = list.stream().collect(Collectors.groupingBy(MaterialCategoryDTO::getCategoryParentId));
handerSonMaterial(handerList, map);
return resultResponse(HaoBanErrCode.ERR_1,handerList);
}
private void handerSonMaterial(List<MaterialVO> handerList,Map<String,List<MaterialCategoryDTO>> map){
for (MaterialVO materialVO : handerList) {
List<MaterialCategoryDTO> sonList = map.get(materialVO.getCategoryParentId());
List<MaterialVO> sonVoList = EntityUtil.changeEntityListByJSON(MaterialVO.class, sonList);
materialVO.setList(sonVoList);
while(sonList != null){
handerSonMaterial(sonVoList, map);
}
}
}
}
package com.gic.haoban.manage.web.vo;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
public class MaterialVO implements Serializable{
private String categoryId;
private String categoryName;
private String categoryParentId;
private String wxEnterpriseId;
private Integer statusFlag;
private List<MaterialVO> list;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public String getCategoryId() {
return categoryId;
}
public void setCategoryId(String categoryId) {
this.categoryId = categoryId == null ? null : categoryId.trim();
}
public String getCategoryName() {
return categoryName;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName == null ? null : categoryName.trim();
}
public String getCategoryParentId() {
return categoryParentId;
}
public void setCategoryParentId(String categoryParentId) {
this.categoryParentId = categoryParentId == null ? null : categoryParentId.trim();
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId == null ? null : wxEnterpriseId.trim();
}
public Integer getStatusFlag() {
return statusFlag;
}
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public List<MaterialVO> getList() {
return list;
}
public void setList(List<MaterialVO> list) {
this.list = list;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment