Commit 9daf2db2 by qwmqiuwenmin
parents 5e840c54 13e40113
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 Integer hideFlag;
private String code;
private String moduleData;
private static final long serialVersionUID = 1L;
public Integer getHideFlag() {
return hideFlag;
}
public void setHideFlag(Integer hideFlag) {
this.hideFlag = hideFlag;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getModuleData() {
return moduleData;
}
public void setModuleData(String moduleData) {
this.moduleData = moduleData;
}
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 Integer hideFlag;
private String code;
private String moduleData;
private List<MaidianDictDTO> pageList;
private static final long serialVersionUID = 1L;
public Integer getHideFlag() {
return hideFlag;
}
public void setHideFlag(Integer hideFlag) {
this.hideFlag = hideFlag;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getModuleData() {
return moduleData;
}
public void setModuleData(String moduleData) {
this.moduleData = moduleData;
}
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.io.Serializable;
import java.util.Date;
public class MaterialCategoryDTO 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;
}
}
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
public class MaterialDTO implements Serializable{
private String materialId;
private String materialTitle;
private Integer materialType;
private String categoryId;
private String materialContent;
private Date wxLastUploadTime;
private String mediaId;
private String mediaid;
private String wxEnterpriseId;
private String staffId;
private String staffName;
private String imgUrl;
private String wxImgUrl;
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 Date getWxLastUploadTime() {
return wxLastUploadTime;
}
public void setWxLastUploadTime(Date wxLastUploadTime) {
this.wxLastUploadTime = wxLastUploadTime;
}
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;
}
public String getMediaid() {
return mediaId;
}
public void setMediaid(String mediaid) {
this.mediaid = mediaid;
}
public String getWxImgUrl() {
return wxImgUrl;
}
public void setWxImgUrl(String wxImgUrl) {
this.wxImgUrl = wxImgUrl;
}
}
......@@ -10,4 +10,8 @@ public interface ApplicationApiService {
List<ApplicationDTO> listByApplications(List<String> applicationIds);
List<ApplicationDTO> listApplicationByWxEnterpriseId(String wxEnterpriseId);
void insertApplicationRelation(String wxEnterpriseId);
}
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);
String reUpdalodMetail(String materialId);
List<MaterialCategoryDTO> listByParentCategory(String categoryId);
}
package com.gic.haoban.manage.api.service;
import java.util.Date;
import java.util.List;
import com.gic.api.base.commons.JSONResponse;
import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.manage.api.dto.MemberStoreDTO;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
......@@ -17,6 +21,8 @@ public interface MemberUnionidRelatedApiService {
List<MemberUnionidRelatedDTO> getByWxUserIdAndWxEnterpriseId(String wxUserId, String wxEnterpriseId);
List<MemberUnionidRelatedDTO> listByEnterpriseIdAndDate(String enterpriseId,Date date);
List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String wxUserId);
String add(String wxEnterpriseId, String selfExternalUserId, String userId1);
......@@ -25,4 +31,13 @@ public interface MemberUnionidRelatedApiService {
public void cleanByCid(String cid);
Page<MemberUnionidRelatedDTO> pageMemberUnionByParams(List<String> userIdList, List<String> sendMemberIds,
String enterpriseId, BasePageInfo pageInfo);
String sendMessage(String wxEnterpriseId, String userId, List<String> extendUserList, String materialId);
JSONResponse getMessageStatus(String wxEnterpriseId, String wxMessageId);
List<MemberUnionidRelatedDTO> getByWxUserIdListAndWxEnterpriseId(List<String> userIdList, String wxEnterpriseId);
}
......@@ -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);
......@@ -79,4 +80,6 @@ public interface StaffApiService {
public ServiceResponse<String> getStaffQrcode(String clerkCode, String storeId);
void wxFristAdd(String userJson, String wxEnterpriseId);
List<String> listBindClerkUserId(String storeId);
}
......@@ -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);
......
......@@ -4,4 +4,10 @@ package com.gic.haoban.manage.api.service;
* Created by tgs on 2020/2/9.
*/
public interface TestApiService {
/**
* 测试
* @param id
* @return
*/
public String checkThread(String id,Long expireTime);
}
......@@ -37,4 +37,6 @@ public interface WxEnterpriseApiService {
List<YwWxEnterpriseDTO> listAll();
List<YwWxEnterpriseDTO> listByIds(Set<String> enterpriseIds);
boolean enterpriseIsOver(String enterpriseId);
}
package com.gic.haoban.manage.api.service;
import java.util.Date;
import java.util.List;
import com.gic.haoban.manage.api.dto.EnterpriseDetailDTO;
......@@ -19,4 +20,10 @@ public interface WxEnterpriseRelatedApiService {
List<EnterpriseDetailDTO> listEnterpriseByEnterpriseIds(List<String> enterpriseIds);
/**
* 返回在一定时期内的信息
* @return
*/
List<EnterpriseDetailDTO> queryBindGicEnterpriseByTime(String seqTime);
}
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;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import com.gic.haoban.manage.service.entity.MemberUnionidRelated;
import com.github.pagehelper.Page;
public interface MemberUnionidRelatedMapper {
int deleteByPrimaryKey(String memberUnionidRelatedId);
......@@ -24,12 +26,21 @@ public interface MemberUnionidRelatedMapper {
MemberUnionidRelated getByUnionId(@Param("wxUserId")String wxUserId, @Param("unionid")String unionid);
MemberUnionidRelated getByMemberId(@Param("wxUserId")String wxUserId, @Param("memberId")String memberId);
void deleteByUnionidAndUserId(@Param("externalUserid")String externalUserid,@Param("wxUserId") String wxUserId);
List<MemberUnionidRelated> getByWxUserIdAndWxEnterpriseId(@Param("wxUserId")String wxUserId, @Param("wxEnterpriseId")String wxEnterpriseId);
List<MemberUnionidRelated> listByEnterpriseIdAndDate(@Param("enterpriseId")String enterpriseId,@Param("date")Date date);
MemberUnionidRelated getByParams(@Param("wxUserId")String wxUserId, @Param("enterpriseId")String enterpriseId,
@Param("externalName")String name, @Param("addCreateTime")String createTime);
List<MemberUnionidRelated> listByExTernalUseridAndWxUserId(@Param("externalUserid")String externalUserid, @Param("wxUserId")String wxUserId);
Page<MemberUnionidRelated> pageMemberUnionByParams(@Param("userIdList")List<String> userIdList, @Param("sendMemberIds")List<String> sendMemberIds,
@Param("enterpriseId")String enterpriseId);
List<MemberUnionidRelated> getByWxUserIdListAndWxEnterpriseId(@Param("userIdList")List<String> userIdList, @Param("wxEnterpriseId")String wxEnterpriseId);
}
\ No newline at end of file
......@@ -48,6 +48,8 @@ public interface StaffDepartmentRelatedMapper {
List<TabHaobanStaffDepartmentRelated> listByClerkCode(@Param("clerkCode")String clerkCode);
List<TabHaobanStaffDepartmentRelated> listByWxEnterpriseIdAndClerkCode(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("clerkCode")String clerkCode);
List<TabHaobanStaffDepartmentRelated> listStaffDepartmentByStaffIds(@Param("staffIds")List<String> staffIds);
}
\ No newline at end of file
......@@ -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);
List<TabHaobanMaterialCategory> listByParentCategory(@Param("categoryId")String categoryId);
}
\ 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.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);
List<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.dao.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated;
public interface TabHaobanWxEnterpriseApplicationRelatedMapper {
int deleteByPrimaryKey(String wxEnterpriseApplicationRelatedId);
int insert(TabHaobanWxEnterpriseApplicationRelated record);
int insertSelective(TabHaobanWxEnterpriseApplicationRelated record);
TabHaobanWxEnterpriseApplicationRelated selectByPrimaryKey(String wxEnterpriseApplicationRelatedId);
int updateByPrimaryKeySelective(TabHaobanWxEnterpriseApplicationRelated record);
int updateByPrimaryKey(TabHaobanWxEnterpriseApplicationRelated record);
TabHaobanWxEnterpriseApplicationRelated selectByApplicationIdAndWxEnterpriseId(@Param("applicationId")String applicationId,
@Param("wxEnterpriseId")String wxEnterpriseId);
List<TabHaobanWxEnterpriseApplicationRelated> listByWxEnterpriseId(@Param("wxEnterpriseId")String wxEnterpriseId);
}
\ No newline at end of file
package com.gic.haoban.manage.service.dao.mapper;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
......@@ -27,4 +28,5 @@ public interface WxEnterpriseRelatedMapper {
List<TabHaobanWxEnterpriseRelated> listEnterpriseByEnterpriseIds(@Param("enterpriseIds")List<String> enterpriseIds);
List<TabHaobanWxEnterpriseRelated> listEnterpriseByTime(@Param("time")String time);
}
\ 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 String moduleData;
private Integer hideFlag;
private String code;
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();
}
public String getModuleData() {
return moduleData;
}
public void setModuleData(String moduleData) {
this.moduleData = moduleData == null ? null : moduleData.trim();
}
public Integer getHideFlag() {
return hideFlag;
}
public void setHideFlag(Integer hideFlag) {
this.hideFlag = hideFlag;
}
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 TabHaobanMaterial implements Serializable {
private String materialId;
private String materialTitle;
private Integer materialType;
private String categoryId;
private String materialContent;
private Date wxLastUploadTime;
private String mediaId;
private String wxEnterpriseId;
private String staffId;
private String staffName;
private String wxImgUrl;
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 Date getWxLastUploadTime() {
return wxLastUploadTime;
}
public void setWxLastUploadTime(Date wxLastUploadTime) {
this.wxLastUploadTime = wxLastUploadTime;
}
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;
}
public String getWxImgUrl() {
return wxImgUrl;
}
public void setWxImgUrl(String wxImgUrl) {
this.wxImgUrl = wxImgUrl;
}
}
\ 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.entity;
import java.io.Serializable;
import java.util.Date;
public class TabHaobanWxEnterpriseApplicationRelated implements Serializable {
private String wxEnterpriseApplicationRelatedId;
private String applicationId;
private String wxEnterpriseId;
private Integer statusFlag;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public String getWxEnterpriseApplicationRelatedId() {
return wxEnterpriseApplicationRelatedId;
}
public void setWxEnterpriseApplicationRelatedId(String wxEnterpriseApplicationRelatedId) {
this.wxEnterpriseApplicationRelatedId = wxEnterpriseApplicationRelatedId == null ? null : wxEnterpriseApplicationRelatedId.trim();
}
public String getApplicationId() {
return applicationId;
}
public void setApplicationId(String applicationId) {
this.applicationId = applicationId == null ? null : applicationId.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);
List<MaterialCategoryDTO> listByParentCategory(String categoryId);
}
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);
}
......@@ -3,11 +3,14 @@ package com.gic.haoban.manage.service.service;
import java.util.List;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import com.gic.haoban.manage.service.entity.MemberUnionidRelated;
public interface MemberUnionRelatedService {
MemberUnionidRelatedDTO getByUnionId(String wxUserId, String unionid);
MemberUnionidRelatedDTO getByMemberId(String wxUserId, String memberId);
String addMemberUnionidRelated(MemberUnionidRelatedDTO dto);
void delMemberUnionidRelated(MemberUnionidRelatedDTO dto);
......@@ -20,4 +23,6 @@ public interface MemberUnionRelatedService {
void clean(String cid);
com.github.pagehelper.Page<MemberUnionidRelated> pageMemberUnionByParams(List<String> userIdList, List<String> sendMemberIds,
String enterpriseId);
}
package com.gic.haoban.manage.service.service;
import java.util.List;
import java.util.Set;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated;
public interface WxEnterpriseApplicationRelatedService {
void saveEnterpriseApplicationRelateds(Set<String> applicationSet, String wxEnterpriseId);
List<TabHaobanWxEnterpriseApplicationRelated> listByWxEnterpriseId(String wxEnterpriseId);
}
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));
}
@Override
public List<MaterialCategoryDTO> listByParentCategory(String categoryId) {
return EntityUtil.changeEntityListByJSON(MaterialCategoryDTO.class, mapper.listByParentCategory(categoryId));
}
}
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);
}
}
......@@ -13,6 +13,7 @@ import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import com.gic.haoban.manage.service.dao.mapper.MemberUnionidRelatedMapper;
import com.gic.haoban.manage.service.entity.MemberUnionidRelated;
import com.gic.haoban.manage.service.service.MemberUnionRelatedService;
import com.github.pagehelper.Page;
@Service
public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService {
......@@ -24,7 +25,10 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService
public MemberUnionidRelatedDTO getByUnionId(String wxUserId, String unionid) {
return EntityUtil.changeEntityByJSON(MemberUnionidRelatedDTO.class,mapper.getByUnionId(wxUserId,unionid));
}
@Override
public MemberUnionidRelatedDTO getByMemberId(String wxUserId, String memberId) {
return EntityUtil.changeEntityByJSON(MemberUnionidRelatedDTO.class,mapper.getByMemberId(wxUserId,memberId));
}
@Override
public String addMemberUnionidRelated(MemberUnionidRelatedDTO dto) {
dto.setStatusFlag(1);
......@@ -60,4 +64,10 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService
public void clean(String cid) {
mapper.cleanByCid(cid);
}
@Override
public Page<MemberUnionidRelated> pageMemberUnionByParams(List<String> userIdList, List<String> sendMemberIds,
String enterpriseId) {
return mapper.pageMemberUnionByParams(userIdList,sendMemberIds,enterpriseId);
}
}
......@@ -30,7 +30,7 @@ public class StaffServiceImpl implements StaffService {
@Override
public TabHaobanStaff selectByNationcodeAndPhoneNumber(String wxEnterpriseId,String nationcode, String phoneNumber) {
if(StringUtils.isBlank(phoneNumber) || "--".equals(phoneNumber)){
if(StringUtils.isBlank(phoneNumber)){
return null;
}
return mapper.selectByNationcodeAndPhoneNumber(wxEnterpriseId,nationcode,phoneNumber);
......
package com.gic.haoban.manage.service.service.impl;
import java.util.Date;
import java.util.List;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanWxEnterpriseApplicationRelatedMapper;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated;
import com.gic.haoban.manage.service.service.WxEnterpriseApplicationRelatedService;
@Service
public class WxEnterpriseApplicationRelatedServiceImpl implements WxEnterpriseApplicationRelatedService{
@Autowired
private TabHaobanWxEnterpriseApplicationRelatedMapper mapper;
@Override
public void saveEnterpriseApplicationRelateds(Set<String> applicationSet,String wxEnterpriseId){
List<TabHaobanWxEnterpriseApplicationRelated> list = mapper.listByWxEnterpriseId(wxEnterpriseId);
//删除已经设置过的 这次不设置的应用
for (TabHaobanWxEnterpriseApplicationRelated tabHaobanWxEnterpriseApplicationRelated : list) {
if(!applicationSet.contains(tabHaobanWxEnterpriseApplicationRelated.getApplicationId())){
mapper.deleteByPrimaryKey(tabHaobanWxEnterpriseApplicationRelated.getWxEnterpriseApplicationRelatedId());
}
}
//新增设置的应用
for (String applicationId : applicationSet) {
TabHaobanWxEnterpriseApplicationRelated tab = mapper.selectByApplicationIdAndWxEnterpriseId(applicationId,wxEnterpriseId);
if(tab == null){
tab = new TabHaobanWxEnterpriseApplicationRelated();
tab.setApplicationId(applicationId);
tab.setCreateTime(new Date());
tab.setUpdateTime(tab.getCreateTime());
tab.setStatusFlag(1);
tab.setWxEnterpriseId(wxEnterpriseId);
tab.setWxEnterpriseApplicationRelatedId(StringUtil.randomUUID());
mapper.insert(tab);
}
}
}
@Override
public List<TabHaobanWxEnterpriseApplicationRelated> listByWxEnterpriseId(String wxEnterpriseId) {
return mapper.listByWxEnterpriseId(wxEnterpriseId);
}
}
package com.gic.haoban.manage.service.service.out.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -8,10 +11,13 @@ import cn.hutool.core.collection.CollectionUtil;
import com.gic.commons.util.EntityUtil;
import com.gic.haoban.manage.api.dto.ApplicationDTO;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import com.gic.haoban.manage.api.service.ApplicationApiService;
import com.gic.haoban.manage.service.dao.mapper.ApplicationMapper;
import com.gic.haoban.manage.service.entity.TabHaobanApplication;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated;
import com.gic.haoban.manage.service.service.ApplicationService;
import com.gic.haoban.manage.service.service.WxEnterpriseApplicationRelatedService;
import org.springframework.stereotype.Service;
......@@ -22,6 +28,8 @@ public class ApplicationApiServiceImpl implements ApplicationApiService {
private ApplicationService applicationService;
@Autowired
private ApplicationMapper applicationMapper;
@Autowired
private WxEnterpriseApplicationRelatedService wxEnterpriseApplicationRelatedService;
@Override
public List<ApplicationDTO> listApplication() {
List<TabHaobanApplication> list = applicationService.listApplication();
......@@ -37,5 +45,31 @@ public class ApplicationApiServiceImpl implements ApplicationApiService {
List<ApplicationDTO> result = EntityUtil.changeEntityListByJSON(ApplicationDTO.class, list);
return result;
}
void saveEnterpriseApplicationRelateds(Set<String> applicationSet, String wxEnterpriseId){
wxEnterpriseApplicationRelatedService.saveEnterpriseApplicationRelateds(applicationSet, wxEnterpriseId);
}
@Override
public List<ApplicationDTO> listApplicationByWxEnterpriseId(String wxEnterpriseId) {
List<TabHaobanApplication> list = applicationService.listApplication();
List<TabHaobanWxEnterpriseApplicationRelated> relatedList = wxEnterpriseApplicationRelatedService.listByWxEnterpriseId(wxEnterpriseId);
List<String> applicationIds = relatedList.stream().map(s->s.getApplicationId()).collect(Collectors.toList());
List<TabHaobanApplication> result = new ArrayList<TabHaobanApplication>();
for (TabHaobanApplication tabHaobanApplication : list) {
if(applicationIds.contains(tabHaobanApplication.getApplicationId())){
result.add(tabHaobanApplication);
}
}
return EntityUtil.changeEntityListByJSON(ApplicationDTO.class, result);
}
@Override
public void insertApplicationRelation(String wxEnterpriseId) {
List<TabHaobanApplication> list = applicationService.listApplication();
Set<String> applicationSet = list.stream().map(TabHaobanApplication::getApplicationId).collect(Collectors.toSet());
wxEnterpriseApplicationRelatedService.saveEnterpriseApplicationRelateds(applicationSet, wxEnterpriseId);
}
}
......@@ -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置空
......@@ -154,11 +190,11 @@ public class BindApiServiceImpl implements BindApiService {
//别人的clerkCOde换到自己上
StaffDepartmentRelatedDTO dto = staffDepartmentRelatedApiService.getOneByStaffIdAndDepartmentId(toStaffId, departmentId);
logger.info("3333333333333");
String sendClerkCode = dto.getClerkCode();
dto.setClerkCode(fromClerkCode);
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 +220,25 @@ public class BindApiServiceImpl implements BindApiService {
clerkDTO.setHeadImgUrl("");
clerkService.updateClerk(clerkDTO);
}
//发送消息
if(StringUtil.isNotBlank(sendClerkCode)){
//发送消息
ClerkDTO leader = clerkService.getClerkLeaderByStoreId(storeId);
String clerkId = leader.getClerkId();
String storeName = departmentDTO.getDepartmentName();
String staffName = staffDTO.getStaffName();
String leaderName = leader.getClerkName();
String clerkCode = sendClerkCode;
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 +258,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 +317,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 +325,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.updateByPrimaryKeySelective(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.setDictId(UuidUtil.randomUUID());
tabHaobanMaidianDictMapper.insert(tab);
}else{
//更新
tab.setUpdateTime(new Date());
tabHaobanMaidianDictMapper.updateByPrimaryKeySelective(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.Date;
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.alibaba.fastjson.JSONObject;
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.entity.TabHaobanMaterial;
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(type == 3){
String imgUrl = materialDTO.getImgUrl();
logger.info("【上传图片】imgUrl={}",imgUrl);
JSONResponse response = qywxSuiteApiService.uploadImage(enterprise.getCorpid(), config.getWxSuiteid(), getFileByte(imgUrl));
logger.info("【上传图片返回】response={}",JSON.toJSONString(response));
String wxImgUrl = response.getResult() == null ? "" : response.getResult().toString();
materialDTO.setWxImgUrl(wxImgUrl);
}
if(fileType != null){
String[] arr = url.split("/");
int count = arr.length;
JSONResponse jp = qywxSuiteApiService.uploadMedia(enterprise.getCorpid(), config.getWxSuiteid(), getFileByte(url),arr[count - 1], fileType.getCode());
if(jp.getErrorCode() == 0){
materialDTO.setWxLastUploadTime(new Date());
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(type == 3){
String imgUrl = materialDTO.getImgUrl();
String oldImgUrl = materialDTO.getImgUrl();
if(!imgUrl.equals(oldImgUrl)){
JSONResponse response = qywxSuiteApiService.uploadImage(enterprise.getCorpid(), config.getWxSuiteid(), getFileByte(imgUrl));
String wxImgUrl = response.getResult() == null ? "" : response.getResult().toString();
materialDTO.setWxImgUrl(wxImgUrl);
}
}
if(fileType != null && !url.equals(oldUrl)){
String[] arr = url.split("/");
int count = arr.length;
JSONResponse jp = qywxSuiteApiService.uploadMedia(enterprise.getCorpid(), config.getWxSuiteid(), getFileByte(url),arr[count - 1], fileType.getCode());
if(jp.getErrorCode() == 0){
materialDTO.setWxLastUploadTime(new Date());
materialDTO.setMediaId(jp.getResult().toString());
materialService.edit(materialDTO);
}
}else{
materialService.edit(materialDTO);
}
}
@Override
public String reUpdalodMetail(String materialId){
MaterialDTO old = materialService.selectMaterialById(materialId);
Integer type = old.getMaterialType();
if(type == null){
return "";
}
String wxEnterpriseId = old.getWxEnterpriseId();
WxEnterpriseDTO enterprise = wxEnterpriseService.selectById(wxEnterpriseId);
if(enterprise == null){
return "";
}
String url = "";
String oldUrl = "";
QywxMediaTypeEnum fileType = null;
if(type == 2){
fileType = QywxMediaTypeEnum.IMAGE;
url = old.getImgUrl();
}
if(type == 4){
fileType = QywxMediaTypeEnum.VIDEO;
url = old.getLink();
}
if(type == 5){
fileType = QywxMediaTypeEnum.FILE;
url = old.getLink();
}
String[] arr = url.split("/");
int count = arr.length;
JSONResponse jp = qywxSuiteApiService.uploadMedia(enterprise.getCorpid(), config.getWxSuiteid(), getFileByte(url),arr[count - 1], fileType.getCode());
if(jp.getErrorCode() == 0){
old.setWxLastUploadTime(new Date());
old.setMediaId(jp.getResult().toString());
materialService.edit(old);
}
return old.getMediaId();
}
@Override
public Page<MaterialDTO> listMaterial(String wxEnterpriseId, String keyword, String categoryId,
Integer materialType,BasePageInfo pageInfo) {
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
com.github.pagehelper.Page<TabHaobanMaterial> page = materialService.listMaterial(wxEnterpriseId,keyword,categoryId,materialType);
return PageUtil.changePageHelperToCurrentPage(page,MaterialDTO.class);
}
public static void main(String[] args) {
String str = "https://other-1251519181.cos.ap-shanghai.myqcloud.com/haoban/20200518101933/【④好办-数据】(1)(1).xlsx";
int count = str.split("/").length;
System.err.println(str.split("/")[count - 1]);
}
private static byte[] getFileByte(String url) {
try {
InputStream in = new URL(url).openStream();
byte[] data = IOUtils.toByteArray(in);
return data;
}catch (Exception e){
logger.info("【异常】"+e.getMessage(),e);
}
return null;
}
@Override
public List<MaterialCategoryDTO> listByParentCategory(String categoryId) {
return materialCategoryService.listByParentCategory(categoryId);
}
}
......@@ -6,11 +6,18 @@ import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.gic.wechat.api.dto.qywx.QywxIinkExternalMessageDTO;
import com.gic.wechat.api.dto.qywx.QywxImageExternalMessageDTO;
import com.gic.wechat.api.dto.qywx.QywxTextExternalMessageDTO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.github.pagehelper.PageHelper;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
......@@ -19,20 +26,28 @@ import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gic.api.base.commons.JSONResponse;
import com.gic.api.base.commons.Page;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.DateUtil;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.MD5Utils;
import com.gic.commons.util.Md5Util;
import com.gic.commons.util.StringUtil;
import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.contacts.manage.api.dto.SearchDataDTO;
import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.MaterialDTO;
import com.gic.haoban.manage.api.dto.MemberStoreDTO;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.api.service.MaterialApiService;
import com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
......@@ -105,9 +120,12 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
private ClerkMainStoreRelatedService clerkMainStoreRelatedService;
@Autowired
private StoreService storeService;
@Autowired
private Config config;
@Autowired
private QywxSuiteApiService qywxSuiteApiService;
@Autowired
private MaterialApiService materialApiService;
@Override
public List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String wxUserId) {
......@@ -605,8 +623,12 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
@Override
public MemberUnionidRelatedDTO getByMemberId(String staffId, String memberId) {
return null;
TabHaobanStaff staff = staffService.selectById(staffId);
if(staff == null){
return null;
}
log.info("【查询会员】wxUserId={},unionid={}",staff.getWxUserId(),memberId);
return memberUnionRelatedService.getByMemberId(staff.getWxUserId(),memberId);
}
@Override
public List<MemberUnionidRelatedDTO> getByWxUserIdAndWxEnterpriseId(String wxUserId, String wxEnterpriseId) {
......@@ -614,6 +636,12 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
return list;
}
@Override
public List<MemberUnionidRelatedDTO> listByEnterpriseIdAndDate( String enterpriseId,Date date) {
List<MemberUnionidRelated> list = memberUnionidRelatedMapper.listByEnterpriseIdAndDate(enterpriseId,date);
return EntityUtil.changeEntityListByJSON(MemberUnionidRelatedDTO.class,list);
}
@Override
public void freshWxFrend(String wxEnterpriseId, String wxUserId) {
log.info("【刷下好友】wxUserId={}",wxUserId);
WxEnterpriseDTO enterprise = wxEnterpriseService.selectById(wxEnterpriseId);
......@@ -651,4 +679,70 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
memberUnionRelatedService.clean(null);
}
}
@Override
public Page<MemberUnionidRelatedDTO> pageMemberUnionByParams(List<String> userIdList, List<String> sendMemberIds,
String enterpriseId, BasePageInfo pageInfo) {
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
return PageUtil.changePageHelperToCurrentPage(memberUnionRelatedService.pageMemberUnionByParams(userIdList,sendMemberIds,enterpriseId),MemberUnionidRelatedDTO.class);
}
@Override
public String sendMessage(String wxEnterpriseId,String userId,List<String> extendUserList,String materialId){
WxEnterpriseDTO enterprise = wxEnterpriseService.selectById(wxEnterpriseId);
MaterialDTO material = materialApiService.selectMaterialById(materialId);
if(material == null){
return "";
}
JSONResponse jp = null;
if(material.getMaterialType() == 2 || material.getMaterialType() == 4 || material.getMaterialType() == 5){
Date wxLastTime = material.getWxLastUploadTime();
String maerialId = material.getMediaId();
if(DateUtil.addDay(wxLastTime, 3).getTime() < System.currentTimeMillis()){
maerialId = materialApiService.reUpdalodMetail(materialId);
}
QywxImageExternalMessageDTO dto = new QywxImageExternalMessageDTO();
dto.setMediaId(maerialId);
dto.setChatType("single");
dto.setExternalUserid(extendUserList);
dto.setSenderUserId(userId);
log.info("【发送消息】dto = {}",JSON.toJSONString(dto));
jp = qywxSuiteApiService.sendExternalMessage(enterprise.getCorpid(), config.getWxSuiteid(), dto);
}else if(material.getMaterialType() == 1){
QywxTextExternalMessageDTO dto = new QywxTextExternalMessageDTO();
dto.setChatType("single");
dto.setExternalUserid(extendUserList);
dto.setSenderUserId(userId);
dto.setText(material.getMaterialContent());
log.info("【发送消息】dto = {}",JSON.toJSONString(dto));
jp = qywxSuiteApiService.sendExternalMessage(enterprise.getCorpid(), config.getWxSuiteid(), dto);
}else if(material.getMaterialType() == 3){
QywxIinkExternalMessageDTO dto = new QywxIinkExternalMessageDTO();
dto.setChatType("single");
dto.setExternalUserid(extendUserList);
dto.setSenderUserId(userId);
dto.setDesc(material.getMaterialDesc());
dto.setPicurl(material.getWxImgUrl());
dto.setTitle(material.getMaterialTitle());
dto.setUrl(material.getLink());
log.info("【发送消息】dto = {}",JSON.toJSONString(dto));
jp = qywxSuiteApiService.sendExternalMessage(enterprise.getCorpid(), config.getWxSuiteid(), dto);
}
log.info("【发送消息】jp = {}",JSON.toJSONString(jp));
Map<String,Object> returnMap = jp.getReturnMap();
return returnMap.get("msgid") == null?"":returnMap.get("msgid").toString();
}
@Override
public JSONResponse getMessageStatus(String wxEnterpriseId, String wxMessageId) {
WxEnterpriseDTO enterprise = wxEnterpriseService.selectById(wxEnterpriseId);
if(enterprise == null){
return null;
}
JSONResponse jp = qywxSuiteApiService.resultExternalMessage(enterprise.getCorpid(), config.getWxSuiteid(), wxMessageId);
return jp;
}
@Override
public List<MemberUnionidRelatedDTO> getByWxUserIdListAndWxEnterpriseId(List<String> userIdList,
String wxEnterpriseId) {
return EntityUtil.changeEntityListByJSON(MemberUnionidRelatedDTO.class, memberUnionidRelatedMapper.getByWxUserIdListAndWxEnterpriseId(userIdList,wxEnterpriseId));
}
}
......@@ -29,10 +29,14 @@ import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper;
import com.gic.haoban.manage.service.entity.TabHaobanApplication;
import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated;
import com.gic.haoban.manage.service.service.ApplicationService;
import com.gic.haoban.manage.service.service.DepartmentService;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
import com.gic.wechat.api.dto.qywx.ItemDTO;
import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
......@@ -54,7 +58,10 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
private QywxSuiteApiService qywxSuiteApiService;
@Autowired
private WxEnterpriseMapper wxEnterpriseMapper;
@Autowired
private WxEnterpriseRelatedMapper wxEnterpriseRelatedMapper;
@Autowired
private DepartmentService departmentService;
@Autowired
private Config config;
......@@ -137,12 +144,24 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
if(StringUtil.isEmpty(clerkCode) ){
return map;
}
List<TabHaobanStaffDepartmentRelated> list = staffDepartmentRelatedMapper.listByClerkCode(clerkCode);
if(CollectionUtil.isEmpty(list)){
String enterpriseId = clerkDTO.getEnterpriseId();
TabHaobanWxEnterpriseRelated relate = wxEnterpriseRelatedMapper.findOneByEnterpriseId(enterpriseId);
if(relate == null){
return map;
}
String wxEnterpriseId = relate.getWxEnterpriseId();
String storeId = clerkDTO.getStoreId();
TabHaobanDepartment tabDepart = departmentService.selectByRelatedId(storeId);
if(tabDepart == null){
return map;
}
String departmentId = tabDepart.getDepartmentId();
TabHaobanStaffDepartmentRelated tabHaobanStaffDepartmentRelated = staffDepartmentRelatedMapper.getDepartmentIdAndCode(departmentId, clerkCode);
if(tabHaobanStaffDepartmentRelated == null){
return map;
}
String wxUserId = list.get(0).getWxUserId();
String wxEnterpriseId = list.get(0).getWxEnterpriseId();
String wxUserId = tabHaobanStaffDepartmentRelated.getWxUserId();
TabHaobanWxEnterprise tabHaobanWxEnterprise = wxEnterpriseMapper.selectByPrimaryKey(wxEnterpriseId);
map.put("wxUserId", wxUserId);
......
package com.gic.haoban.manage.service.service.out.impl;
import com.gic.haoban.manage.api.service.TestApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
/**
* Created by tgs on 2020/2/9.
*/
public class TestServiceImpl {
@Service
public class TestServiceImpl implements TestApiService {
private static final Logger logger= LoggerFactory.getLogger(TestServiceImpl.class);
@Override
public String checkThread(String id, Long expireTime) {
logger.info("测试-start:{}",id);
if (expireTime!=null && expireTime>0) {
logger.info("延时:{}",expireTime);
try {
Thread.sleep(expireTime);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
logger.info("测试-end:{}",id);
return id;
}
}
package com.gic.haoban.manage.service.service.out.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import com.alibaba.fastjson.JSON;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.Constant;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
import com.gic.haoban.manage.service.service.DepartmentService;
import com.gic.wechat.api.dto.qywx.DepartmentDTO;
import com.gic.wechat.api.service.qywx.QywxDepartmentApiService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hutool.core.collection.CollectionUtil;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.haoban.manage.api.dto.QywxCorpInfoSimpleDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.YwWxEnterpriseDTO;
......@@ -48,6 +42,9 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
@Autowired
private WxApplicationService wxApplicationService;
@Autowired
private EnterpriseService enterpriseService;
@Override
public void callbackReviceEnterprise(QywxCorpInfoSimpleDTO dto) {
log.info("企业微信授权信息:{}", JSON.toJSONString(dto));
......@@ -127,4 +124,20 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
wxEnterpriseService.update(enterpriseDTO);
}
@Override
public boolean enterpriseIsOver(String enterpriseId) {
if(StringUtils.isEmpty(enterpriseId)){
return true;
}
EnterpriseDTO enterprise = enterpriseService.getEnterpriseByEid(enterpriseId);
if(enterprise == null || enterprise.getExpireTime() == null){
return true;
}
if(enterprise.getExpireTime().getTime() > System.currentTimeMillis()){
return false;
}
return true;
}
}
......@@ -151,4 +151,10 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
return details;
}
@Override
public List<EnterpriseDetailDTO> queryBindGicEnterpriseByTime(String seqTime) {
List<TabHaobanWxEnterpriseRelated> list= wxEnterpriseRelatedMapper.listEnterpriseByTime(seqTime);
List<EnterpriseDetailDTO> details = EntityUtil.changeEntityListByJSON(EnterpriseDetailDTO.class, list);
return details;
}
}
......@@ -23,6 +23,7 @@
</bean>
<dubbo:service interface="com.gic.haoban.manage.api.service.ApplicationApiService" ref="applicationApiServiceImpl" timeout="10000" />
<dubbo:service interface="com.gic.haoban.manage.api.service.TestApiService" ref="testServiceImpl" timeout="10000" />
<dubbo:service interface="com.gic.haoban.manage.api.service.DepartmentApiService" ref="departmentApiServiceImpl" timeout="10000" />
<dubbo:service interface="com.gic.haoban.manage.api.service.StaffApiService" ref="staffApiServiceImpl" timeout="10000" />
<dubbo:service interface="com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService" ref="wxEnterpriseRelatedApiServiceImpl" timeout="10000" />
......@@ -39,6 +40,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"/>
......@@ -63,5 +66,7 @@
<dubbo:reference id="qqCloudPicService" interface="com.gic.thirdparty.api.service.QQCloudPicService" timeout="10000" retries="0" check="false" />
<dubbo:reference id="innerApiService" interface="com.gic.haoban.app.customer.service.api.service.InnerApiService" timeout="10000" retries="0" check="false" />
<dubbo:reference id="enterpriseService" interface="com.gic.enterprise.api.service.EnterpriseService" timeout="10000" retries="0" check="false" />
</beans>
\ No newline at end of file
......@@ -205,6 +205,16 @@
limit 1
</select>
<select id="getByMemberId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_member_unionid_related
where wx_user_id = #{wxUserId}
and status_flag = 1
and member_id = #{memberId}
limit 1
</select>
<update id="deleteByUnionidAndUserId" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated" >
update tab_haoban_member_unionid_related
set status_flag = 0
......@@ -220,6 +230,17 @@
and status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
</select>
<select id="listByEnterpriseIdAndDate" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_member_unionid_related
where status_flag = 1
and enterprise_id = #{enterpriseId}
<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" />
......@@ -239,4 +260,34 @@
and external_name = #{externalName}
and add_create_time = #{addCreateTime}
</select>
<select id="pageMemberUnionByParams" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_member_unionid_related
where enterprise_id = #{enterpriseId}
and status_flag = 1
and member_id in
<foreach item="memberId" index="index" collection="sendMemberIds" open="(" separator="," close=")">
#{memberId, jdbcType=CHAR}
</foreach>
and wx_user_id in
<foreach item="wxUserId" index="index" collection="userIdList" open="(" separator="," close=")">
#{wxUserId, jdbcType=CHAR}
</foreach>
and member_id is not null
group by external_userid
</select>
<select id="getByWxUserIdListAndWxEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_member_unionid_related
where wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1
and wx_user_id in
<foreach item="wxUserId" index="index" collection="userIdList" open="(" separator="," close=")">
#{wxUserId, jdbcType=CHAR}
</foreach>
</select>
</mapper>
\ No newline at end of file
......@@ -249,6 +249,14 @@
and status_flag = 1
</select>
<select id="listByWxEnterpriseIdAndClerkCode" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff_department_related
where clerk_code = #{clerkCode}
and wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1
</select>
<select id="countByDepartmentId" resultType="java.lang.Integer" parameterType="java.lang.String" >
select
......@@ -299,7 +307,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" />
<result column="module_data" property="moduleData" jdbcType="VARCHAR" />
<result column="hide_flag" property="hideFlag" jdbcType="INTEGER" />
<result column="code" property="code" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
module_id, module_name, create_time, update_time, status, operation_person, module_data,
hide_flag, code
</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,
module_data, hide_flag, code
)
values (#{moduleId,jdbcType=VARCHAR}, #{moduleName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, #{operationPerson,jdbcType=VARCHAR},
#{moduleData,jdbcType=VARCHAR}, #{hideFlag,jdbcType=INTEGER}, #{code,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>
<if test="moduleData != null" >
module_data,
</if>
<if test="hideFlag != null" >
hide_flag,
</if>
<if test="code != null" >
code,
</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>
<if test="moduleData != null" >
#{moduleData,jdbcType=VARCHAR},
</if>
<if test="hideFlag != null" >
#{hideFlag,jdbcType=INTEGER},
</if>
<if test="code != null" >
#{code,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>
<if test="moduleData != null" >
module_data = #{moduleData,jdbcType=VARCHAR},
</if>
<if test="hideFlag != null" >
hide_flag = #{hideFlag,jdbcType=INTEGER},
</if>
<if test="code != null" >
code = #{code,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},
module_data = #{moduleData,jdbcType=VARCHAR},
hide_flag = #{hideFlag,jdbcType=INTEGER},
code = #{code,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>
<select id="listByParentCategory" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_material_category
where status_flag = 1
and category_parent_id = #{categoryId}
</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.TabHaobanWxEnterpriseApplicationRelatedMapper" >
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated" >
<id column="wx_enterprise_application_related_id" property="wxEnterpriseApplicationRelatedId" jdbcType="VARCHAR" />
<result column="application_id" property="applicationId" 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" >
wx_enterprise_application_related_id, application_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_wx_enterprise_application_related
where wx_enterprise_application_related_id = #{wxEnterpriseApplicationRelatedId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from tab_haoban_wx_enterprise_application_related
where wx_enterprise_application_related_id = #{wxEnterpriseApplicationRelatedId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated" >
insert into tab_haoban_wx_enterprise_application_related (wx_enterprise_application_related_id, application_id,
wx_enterprise_id, status_flag, create_time,
update_time)
values (#{wxEnterpriseApplicationRelatedId,jdbcType=VARCHAR}, #{applicationId,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.TabHaobanWxEnterpriseApplicationRelated" >
insert into tab_haoban_wx_enterprise_application_related
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="wxEnterpriseApplicationRelatedId != null" >
wx_enterprise_application_related_id,
</if>
<if test="applicationId != null" >
application_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="wxEnterpriseApplicationRelatedId != null" >
#{wxEnterpriseApplicationRelatedId,jdbcType=VARCHAR},
</if>
<if test="applicationId != null" >
#{applicationId,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.TabHaobanWxEnterpriseApplicationRelated" >
update tab_haoban_wx_enterprise_application_related
<set >
<if test="applicationId != null" >
application_id = #{applicationId,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 wx_enterprise_application_related_id = #{wxEnterpriseApplicationRelatedId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseApplicationRelated" >
update tab_haoban_wx_enterprise_application_related
set application_id = #{applicationId,jdbcType=VARCHAR},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where wx_enterprise_application_related_id = #{wxEnterpriseApplicationRelatedId,jdbcType=VARCHAR}
</update>
<select id="selectByApplicationIdAndWxEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_wx_enterprise_application_related
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and application_id = #{applicationId}
and status_flag = 1
</select>
<select id="listByWxEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_wx_enterprise_application_related
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and status_flag = 1
</select>
</mapper>
\ No newline at end of file
......@@ -148,5 +148,13 @@
</foreach>
</if>
</select>
<select id="listEnterpriseByTime" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from tab_haoban_wx_enterprise_related
where status_flag = 1
AND AND DATE_FORMAT(update_time,'%Y-%m-%d') = #{time}
</select>
</mapper>
\ No newline at end of file
import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.symmetric.AES;
import com.alibaba.fastjson.JSONObject;
import com.gic.haoban.manage.api.dto.SyncSingleDealDTO;
import com.gic.haoban.manage.api.service.DealSyncOperationApiService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Setest {
@Autowired
private DealSyncOperationApiService dealSyncOperationApiService;
@Test
public void test() {
Map<String,String> ret=new HashMap<>();
ret.put("test","test");
ret.put("name","name11");
AES aes = SecureUtil.aes("test111111111113".getBytes());
String code = aes.encryptHex(JSONObject.toJSONString(ret));
System.out.println(code);
String str = aes.decryptStr(code);
System.out.println(str);
}
}
......@@ -65,7 +65,9 @@ public class ApplicationController extends WebBaseController{
@RequestMapping("application-list")
public HaobanResponse applicationList() {
List<ApplicationDTO> list = applicationApiService.listApplication();
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId();
List<ApplicationDTO> list = applicationApiService.listApplicationByWxEnterpriseId(wxEnterpriseId);
return resultResponse(HaoBanErrCode.ERR_1,list);
}
@IgnoreLogin
......@@ -75,7 +77,7 @@ public class ApplicationController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_2);
}
Map<String,Object> map = new HashMap<>();
List<ApplicationDTO> list = applicationApiService.listApplication();
List<ApplicationDTO> list = applicationApiService.listApplicationByWxEnterpriseId(wxEnterpriseId);
List<String> applicationIds = list.stream().map(s->s.getApplicationId()).collect(Collectors.toList());
List<ApplicationSettingDTO> result = applicationSettingApiService.listOpenByWxEnterpriseIdAndApplicationIds(wxEnterpriseId,applicationIds);
//开启
......@@ -142,6 +144,8 @@ public class ApplicationController extends WebBaseController{
dealSyncOperationApiService.dealQywxDepartment(taskId, wxEnterpriseId);
enterpriseDTO.setContactFlag(1);
wxEnterpriseApiService.update(enterpriseDTO);
applicationApiService.insertApplicationRelation(wxEnterpriseId);
// log.info("【初始化部门调用】{},{},{}",RouterConstant.INIT_WX_DEPARTMENT_SERVICENAME,RouterConstant.INIT_WX_DEPARTMENT_METHODNAME,wxEnterpriseId);
// try {
// GICMQClientUtil.getClientInstance().sendCommonMessage(RouterConstant.ROUTERTYPE, wxEnterpriseId,
......
......@@ -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 org.apache.commons.lang3.StringUtils;
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 cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.symmetric.AES;
import com.alibaba.dubbo.common.URL;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.ToolUtil;
import com.gic.commons.web.ResponseThreadLocal;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.EnterpriseDetailDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.web.anno.IgnoreLogin;
import com.gic.haoban.manage.web.auth.AuthRequestUtil;
import com.gic.haoban.manage.web.config.Config;
......@@ -25,23 +21,29 @@ import com.gic.haoban.manage.web.vo.LoginVO;
import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.dto.qywx.UserDTO;
import com.gic.wechat.api.service.qywx.QywxCorpApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.apache.commons.lang3.StringUtils;
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 org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletResponse;
@RestController
public class LoginController extends WebBaseController{
private static Logger logger= LoggerFactory.getLogger(LoginController.class);
private static final String LOGIN_KEY="haoban#login$key";
@Autowired
StaffApiService staffApiService;
......@@ -50,6 +52,9 @@ public class LoginController extends WebBaseController{
@Autowired
private WxEnterpriseApiService wxEnterpriseApiService;
@Autowired
private WxEnterpriseRelatedApiService wxEnterpriseRelatedApiService;
@Autowired
......@@ -134,6 +139,7 @@ public class LoginController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_1,URL.decode(url));
}
//运维登录
@IgnoreLogin
@RequestMapping("yw-login")
......@@ -156,6 +162,56 @@ public class LoginController extends WebBaseController{
AuthRequestUtil.setAppLoginUser(token, loginVO);
try {
Cookie cookie = new Cookie("token", token);
cookie.setPath("/");
response.addCookie(cookie);
response.sendRedirect(redirectUri);
response.setHeader("token", token);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return resultResponse(HaoBanErrCode.ERR_1);
}
//运维登录
@IgnoreLogin
@RequestMapping("gic-login")
public ModelAndView ywLogin(String random,HttpServletResponse response) {
//判断是否存在random
AES aes = SecureUtil.aes(LOGIN_KEY.getBytes());
String o = aes.decryptStr(random);
if(o == null){
logger.info("解密异常");
ModelAndView model = new ModelAndView(new RedirectView("/haoban-3/#/gic-error", false,false));
return model;
}
JSONObject jsonObject = JSONObject.parseObject(o);
String gicEnterpriseId = jsonObject.getString("enterpriseId");
String loginPhoneNumber = jsonObject.getString("phoneNumber");
EnterpriseDetailDTO detailDTO = wxEnterpriseRelatedApiService.getByEnterpriseId(gicEnterpriseId);
if (null == detailDTO) {
logger.info("登录失败,不存在对应企业:{}",o);
ModelAndView model = new ModelAndView(new RedirectView("/haoban-3/#/gic-error", false,false));
return model;
}
//TODO 获取超级管理员账号接口
StaffDTO staff = staffApiService.selectByNationcodeAndPhoneNumber(detailDTO.getWxEnterpriseId(), "86", loginPhoneNumber);
if (null == staff) {
logger.info("登录用户手机号不存在!{}",o);
ModelAndView model = new ModelAndView(new RedirectView("/haoban-3/#/gic-error", false,false));
return model;
}
// StaffDTO staff = staffApiService.selectById("1");
LoginVO loginVO = new LoginVO();
loginVO.setWxEnterpriseId(detailDTO.getWxEnterpriseId());
loginVO.setStaffDTO(staff);
AuthRequestUtil.setSessionUser(loginVO);
String redirectUri = config.getHost() + "index";
redirectUri = redirectUri.replace("haoban-manage3-web", "haoban-3/#");
String token = ToolUtil.randomUUID() + "-" + ToolUtil.randomStringByTime();
AuthRequestUtil.setAppLoginUser(token, loginVO);
try {
Cookie cookie = new Cookie("token", token);
cookie.setPath("/");
response.addCookie(cookie);
response.sendRedirect(redirectUri);
......@@ -163,8 +219,8 @@ public class LoginController extends WebBaseController{
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return resultResponse(HaoBanErrCode.ERR_1);
}
return null;
}
......
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<MaterialCategoryDTO> categoryList = materialApiService.listByParentCategory(categoryId);
if(categoryList != null && !categoryList.isEmpty()){
return resultResponse(HaoBanErrCode.ERR_10017);
}
List<MaterialDTO> list = materialApiService.listMaterialByCategoryId(categoryId);
if(list!= null && !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-edit")
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);
}
}
......@@ -3,15 +3,21 @@ package com.gic.haoban.manage.web.controller;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService;
import com.gic.haoban.manage.api.service.TestApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.QywxXcxSendMessageQo;
import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* Created 2020/4/9.
......@@ -22,12 +28,20 @@ import java.util.ArrayList;
@RequestMapping("/test")
public class TestController extends WebBaseController {
private static final Logger logger= LoggerFactory.getLogger(TestController.class);
@Autowired
private QywxSuiteApiService qywxSuiteApiService;
@Autowired
private MemberUnionidRelatedApiService memberUnionidRelatedApiService;
private final ExecutorService pools = Executors.newFixedThreadPool(500);
@Autowired
private TestApiService testApiService;
@RequestMapping("/send-message-test")
public HaobanResponse testSendMessage(QywxXcxSendMessageQo qo) {
QywxXcxSendMessageDTO messageDTO = EntityUtil.changeEntityByOrika(QywxXcxSendMessageDTO.class, qo);
......@@ -49,4 +63,21 @@ public class TestController extends WebBaseController {
memberUnionidRelatedApiService.cleanByCid(cid);
return resultResponse(HaoBanErrCode.ERR_1);
}
@RequestMapping("/test-dubbo")
public HaobanResponse dubbo(@RequestParam(defaultValue = "2000") Integer n,@RequestParam(defaultValue = "100") String t) {
int i=n;
while (i-->0) {
int finalI = i;
pools.execute(new Runnable(){
@Override
public void run() {
long start = System.currentTimeMillis();
testApiService.checkThread(finalI +"",Long.valueOf(t));
logger.info("时间:{}",System.currentTimeMillis()-start);
}
});
}
return resultResponse(HaoBanErrCode.ERR_1);
}
}
package com.gic.haoban.manage.web.controller;
import java.io.File;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.io.FileUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.DateUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.qcloud.BucketNameEnum;
import com.gic.qcloud.FileUploadUtil;
@RestController
public class UploadController extends WebBaseController{
private static Set<String> FILE_TYPE = new HashSet<>( );
static {
for(BucketNameEnum value: BucketNameEnum.values()){
FILE_TYPE.add( value.getName() );
}
}
@RequestMapping("/upload-file")
@ResponseBody
public HaobanResponse upload(@RequestParam MultipartFile file,@RequestParam String fileType) throws Exception{
if(file == null || file.isEmpty()){
return resultResponse(HaoBanErrCode.ERR_2);
}
String name = file.getOriginalFilename();
String suffix = name.substring(name.lastIndexOf(".") + 1);
String location = System.getProperty( "user.dir" )+"/data/tmp/";
//b
long len = file.getSize();
File templateFile = new File( location+name );
FileUtils.copyInputStreamToFile( file.getInputStream(),templateFile );
// 2.上传腾讯云
String dayFilePath = LocalDateTime.now().format( DateTimeFormatter.ofPattern( DateUtil.FORMAT_DATETIME_14 ) );
String key = "haoban/"+dayFilePath+"/"+name;
fileType = FILE_TYPE.contains( fileType )?fileType:BucketNameEnum.OTHER_90000.getName();
String url = FileUploadUtil.simpleUploadFileFromLocal( templateFile,key,fileType);
if(templateFile != null){
templateFile.delete();
}
JSONObject res = new JSONObject( );
res.put( "name",name );
res.put( "ext", suffix );
res.put( "size",len );
res.put( "key",key );
res.put( "url", "https://"+url );
return resultResponse(HaoBanErrCode.ERR_1, res);
}
}
......@@ -313,5 +313,22 @@ public class WxEnterpriseController extends WebBaseController{
}
//企业信息
@RequestMapping("enterprise-is-over")
public HaobanResponse enterpriseIsOver(String enterpriseId) {
if(StringUtils.isEmpty(enterpriseId)){
return resultResponse(HaoBanErrCode.ERR_2);
}
EnterpriseDTO enterprise = enterpriseService.getEnterpriseByEid(enterpriseId);
if(enterprise == null || enterprise.getExpireTime() == null){
return resultResponse(HaoBanErrCode.ERR_1,false);
}
if(enterprise.getExpireTime().getTime() > System.currentTimeMillis()){
return resultResponse(HaoBanErrCode.ERR_1,false);
}
return resultResponse(HaoBanErrCode.ERR_1,true);
}
}
......@@ -87,7 +87,18 @@ public enum HaoBanErrCode {
ERR_10014(10014,"暂存部门人员不能删除"),
ERR_10015(10015,"分组已存在"),
ERR_10016(10016,"分组不存在"),
ERR_10017(10017,"存在素材不能删除"),
ERR_10018(10018,"素材不存在"),
ERR_10019(10019,"存在子分组不能删除"),
ERR_100015(100015,"暂存部门不能删除"),
ERR_DEFINE(-888, "自定义错误"),
ERR_OTHER(-999, "未知错误code");
......
package com.gic.haoban.manage.web.init;
import com.gic.dict.api.dto.GlobalDictMap;
import com.gic.dict.api.service.ManagerDictService;
import com.gic.quartz.api.dto.QuartzTaskDTO;
import com.gic.quartz.api.service.QuartzService;
......@@ -18,12 +16,29 @@ public class MyApplicationContextAware implements ApplicationContextAware {
private Logger log = LogManager.getLogger(MyApplicationContextAware.class);
private static ApplicationContext applicationContext;
@Autowired
private QuartzService quartzService;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
// TODO Auto-generated method stub
log.info("【定时开始】----------------------");
QuartzTaskDTO taskDTO = buildQuartzMessageDTO("haoban-message-status-time");
taskDTO.setTaskParam("");
taskDTO.setTaskStatus(1);
taskDTO.setTaskTimeInfo("0 30 1 * * *");
// taskDTO.setTaskTimeInfo("0 0/5 * * * *");
quartzService.addOrUpdateQuartzTask(taskDTO);
}
private QuartzTaskDTO buildQuartzMessageDTO(String id) {
QuartzTaskDTO taskDTO = new QuartzTaskDTO();
taskDTO.setReferId(id);
taskDTO.setTaskMethod("quartzUpdateMessageStatus");
taskDTO.setTaskService("com.gic.haoban.app.customer.service.api.service.MessageLogApiService");
return taskDTO;
}
}
......@@ -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"/>
......@@ -58,5 +60,8 @@
<dubbo:reference interface="com.gic.haoban.manage.api.service.DealSyncOperationApiService"
id="dealSyncOperationApiService"/>
<dubbo:reference id="quartzService" interface="com.gic.quartz.api.service.QuartzService" timeout="10000"/>
<dubbo:reference id="testApiService" interface="com.gic.haoban.manage.api.service.TestApiService" timeout="10000"/>
</beans>
......@@ -30,7 +30,7 @@ public class ApplicationController extends WebBaseController{
@RequestMapping("application-list")
public HaobanResponse applicationList(String wxEnterpriseId) {
List<ApplicationDTO> list = applicationApiService.listApplication();
List<ApplicationDTO> list = applicationApiService.listApplicationByWxEnterpriseId(wxEnterpriseId);
List<String> applicationIds = list.stream().map(s->s.getApplicationId()).collect(Collectors.toList());
List<ApplicationSettingDTO> settings = applicationSettingApiService.listOpenByWxEnterpriseIdAndApplicationIds(wxEnterpriseId, applicationIds);
......
......@@ -27,8 +27,8 @@ public class MaidianLogController extends WebBaseController{
List<MaidianLogDTO> maidianLogDTOList = JSON.parseArray(maidianLogStr,MaidianLogDTO.class);
for (MaidianLogDTO maidianLogDTO : maidianLogDTOList) {
String options = maidianLogDTO.getOptions();
if(StringUtils.isNotBlank(options) && options.length() > 128){
maidianLogDTO.setOptions(options.substring(0,127));
if(StringUtils.isNotBlank(options) && options.length() > 2000){
maidianLogDTO.setOptions(options.substring(0,1999));
}
maidianLogApiService.insert(maidianLogDTO);
}
......
package com.gic.haoban.manage.web.controller;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
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.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.DateUtil;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.PageResult2;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.common.utils.PageUtil;
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{
private static Logger logger = LoggerFactory.getLogger(MaterialController.class);
@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);
//暂时转换
PageResult2 pageResult2 = PageUtil.getPageInfo(page);
return resultResponse(HaoBanErrCode.ERR_1, pageResult2);
}
/**
* 素材查询
* @return
*/
@RequestMapping("/material-type")
public HaobanResponse materialType(String wxEnterpriseId) {
List<MaterialCategoryDTO> list = materialApiService.listCategory(wxEnterpriseId);
List<MaterialVO> handerList = new ArrayList<MaterialVO>();
MaterialVO vo = new MaterialVO();
vo.setCategoryId("-1");
vo.setCategoryName("未分组");
vo.setCategoryParentId("0");
vo.setWxEnterpriseId(wxEnterpriseId);
handerList.add(vo);
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);
for (MaterialVO materialVO : handerList) {
List<MaterialVO> sonVoList = materialVO.getList();
if(sonVoList != null && !sonVoList.isEmpty()){
handerSonMaterial(sonVoList, map);
}
}
return resultResponse(HaoBanErrCode.ERR_1,handerList);
}
/**
* 素材查询
* @return
*/
@RequestMapping("/reupdalod-material")
public HaobanResponse reUpdalodMetail(String materialId) {
if(StringUtils.isBlank(materialId)){
return resultResponse(HaoBanErrCode.ERR_10015);
}
MaterialDTO material = materialApiService.selectMaterialById(materialId);
if(material == null){
}
String medialId = "";
if(material.getMaterialType() == 2 || material.getMaterialType() == 4 || material.getMaterialType() == 5){
Date wxLastTime = material.getWxLastUploadTime();
medialId = material.getMediaId();
if(DateUtil.addDay(wxLastTime, 3).getTime() < System.currentTimeMillis()){
medialId = materialApiService.reUpdalodMetail(materialId);
}
}
return resultResponse(HaoBanErrCode.ERR_1,medialId);
}
private void handerSonMaterial(List<MaterialVO> handerList,Map<String,List<MaterialCategoryDTO>> map){
for (MaterialVO materialVO : handerList) {
List<MaterialCategoryDTO> sonList = map.get(materialVO.getCategoryId());
List<MaterialVO> sonVoList = EntityUtil.changeEntityListByJSON(MaterialVO.class, sonList);
materialVO.setList(sonVoList);
// logger.info("map={},handerList={},categoryId={},sonVoList={}",JSON.toJSONString(map),JSON.toJSONString(handerList),materialVO.getCategoryId(),JSON.toJSONString(sonVoList));
// while(sonVoList != null && sonVoList.size() > 0){
// handerSonMaterial(sonVoList, map);
// }
}
}
}
......@@ -28,8 +28,10 @@ import com.gic.dict.api.dto.CityDTO;
import com.gic.dict.api.dto.CountyDTO;
import com.gic.dict.api.dto.GlobalDictMap;
import com.gic.dict.api.dto.ProvinceDTO;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.dto.StorePhotoDTO;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.data.api.dto.HaobanDataDTO;
......@@ -77,6 +79,9 @@ public class StoreController extends WebBaseController{
private AuditSettingApiService auditSettingApiService;
@Autowired
private ClerkMainStoreRelatedApiService clerkMainStoreRelatedApiService;
@Autowired
private EnterpriseService enterpriseService;
//门店列表
@RequestMapping("/store-list")
public HaobanResponse storeList(String staffId,String wxEnterpriseId) {
......@@ -161,6 +166,10 @@ public class StoreController extends WebBaseController{
}else{
VO.setMainStoreFlag(0);
}
boolean flag = isEnterpriseOver(VO.getStoreId());
if(flag){
VO.setStoreStatus(2);
}
}
if(CollectionUtils.isNotEmpty(resultList)){
Map<Integer,StoreVO> map = com.gic.commons.util.CollectionUtil.toMap(resultList, "clerkType");
......@@ -334,5 +343,22 @@ public class StoreController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_1,vo);
}
//获取门店详情
public boolean isEnterpriseOver(String storeId) {
StoreDTO store = storeService.getStore(storeId);
if(store == null){
return true;
}
EnterpriseDTO enterprise = enterpriseService.getEnterpriseByEid(store.getEnterpriseId());
if(enterprise == null || enterprise.getExpireTime() == null){
return false;
}
if(enterprise.getExpireTime().getTime() > System.currentTimeMillis()){
return false;
}
return true;
}
}
......@@ -197,6 +197,8 @@ public enum HaoBanErrCode {
ERR_10012(10012,"手机号格式不正确"),
ERR_10013(10013,"code已经存在"),
ERR_10014(10014,"请输入手机号"),
ERR_10015(10015,"素材不存在"),
ERR_999(999, "操作失败"),
......
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;
}
}
......@@ -25,6 +25,8 @@ public class StoreVO implements Serializable {
private String wxEnterpriseRelatedId;
private Date createTime;
private Integer mainStoreFlag;
private Integer storeStatus ;
public Date getCreateTime() {
return createTime;
......@@ -117,6 +119,12 @@ public class StoreVO implements Serializable {
public void setMainStoreFlag(Integer mainStoreFlag) {
this.mainStoreFlag = mainStoreFlag;
}
public Integer getStoreStatus() {
return storeStatus;
}
public void setStoreStatus(Integer storeStatus) {
this.storeStatus = storeStatus;
}
}
......@@ -52,5 +52,10 @@
<dubbo:reference interface="com.gic.haoban.manage.api.service.MaidianLogApiService" id="maidianLogApiService"/>
<dubbo:reference interface="com.gic.haoban.app.customer.service.api.service.StaffMemberRelationApiService" id="staffMemberRelationApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.MaterialApiService" id="materialApiService"/>
<dubbo:reference interface="com.gic.enterprise.api.service.EnterpriseService" id="enterpriseService"/>
</beans>
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