Commit 5ae73d4c by 墨竹

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

parents d935491c 8df4ed63
...@@ -90,11 +90,18 @@ public class EnterpriseController extends WebBaseController { ...@@ -90,11 +90,18 @@ public class EnterpriseController extends WebBaseController {
* @param openTagFlag 标签开启状态:0 未开启 1 开启 2 所有 * @param openTagFlag 标签开启状态:0 未开启 1 开启 2 所有
* @param gicEnterpriseName gic企业名称 * @param gicEnterpriseName gic企业名称
* @param gicContactHelper 是否开启通讯录应用1是0否 * @param gicContactHelper 是否开启通讯录应用1是0否
* @param loginUserId 登录用户id
* @param version 版本 * @param version 版本
* @return res * @return res
*/ */
@RequestMapping("wx-enterprise-list") @RequestMapping("wx-enterprise-list")
public HaobanResponse wxEnterpriseListNew(BasePageInfo pageInfo, String keyword, Integer openTagFlag, String gicEnterpriseName, Integer gicContactHelper, String version) { public HaobanResponse wxEnterpriseListNew(BasePageInfo pageInfo,
String keyword,
Integer openTagFlag,
String gicEnterpriseName,
Integer gicContactHelper,
String loginUserId,
String version) {
List<String> wxEnterpriseIdInList = Lists.newArrayList(); List<String> wxEnterpriseIdInList = Lists.newArrayList();
...@@ -326,8 +333,6 @@ public class EnterpriseController extends WebBaseController { ...@@ -326,8 +333,6 @@ public class EnterpriseController extends WebBaseController {
} }
/** /**
* 更新新的外部联系人id * 更新新的外部联系人id
* *
...@@ -361,7 +366,7 @@ public class EnterpriseController extends WebBaseController { ...@@ -361,7 +366,7 @@ public class EnterpriseController extends WebBaseController {
if (wxEnterpriseDTO == null) { if (wxEnterpriseDTO == null) {
return resultResponse(HaoBanErrCode.ERR_20001); return resultResponse(HaoBanErrCode.ERR_20001);
} }
wxEnterpriseApiService.agreeExternalUseridFlag(wxEnterpriseDTO.getWxEnterpriseId(),1); wxEnterpriseApiService.agreeExternalUseridFlag(wxEnterpriseDTO.getWxEnterpriseId(), 1);
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} else { } else {
return resultResponse(HaoBanErrCode.ERR_0); return resultResponse(HaoBanErrCode.ERR_0);
......
...@@ -14,132 +14,133 @@ public interface StaffMapper { ...@@ -14,132 +14,133 @@ public interface StaffMapper {
TabHaobanStaff selectByPrimaryKey(String staffId); TabHaobanStaff selectByPrimaryKey(String staffId);
int updateByPrimaryKeySelective(TabHaobanStaff record); int updateByPrimaryKeySelective(TabHaobanStaff record);
TabHaobanStaff selectByNationcodeAndPhoneNumber(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("nationCode") String nationcode, @Param("phoneNumber") String phoneNumber); TabHaobanStaff selectByNationcodeAndPhoneNumber(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("nationCode") String nationcode, @Param("phoneNumber") String phoneNumber);
List<TabHaobanStaff> listByIds(@Param("staffIds") List<String> staffIds); List<TabHaobanStaff> listByIds(@Param("staffIds") List<String> staffIds);
List<TabHaobanStaff> listByWxUserId(@Param("wxUserId") String wxUserId); List<TabHaobanStaff> listByWxUserId(@Param("wxUserId") String wxUserId);
List<TabHaobanStaff> listLikeName(@Param("staffName") String staffName); List<TabHaobanStaff> listLikeName(@Param("staffName") String staffName);
Page<TabHaobanStaff> pageStaff(@Param("staffIds") Set<String> staffIds, @Param("activeFlag") Integer activeFlag, @Param("keyword") String keyword); Page<TabHaobanStaff> pageStaff(@Param("staffIds") Set<String> staffIds, @Param("activeFlag") Integer activeFlag, @Param("keyword") String keyword);
/** /**
* 选择用户id和企业标识 * 选择用户id和企业标识
* *
* @param userId 用户id * @param userId 用户id
* @param wxEnterpriseId wx企业标识 * @param wxEnterpriseId wx企业标识
* @return {@link TabHaobanStaff } * @return {@link TabHaobanStaff }
* @author mozhu * @author mozhu
* @date 2022-01-13 15:05:28 * @date 2022-01-13 15:05:28
*/ */
TabHaobanStaff selectByUserIdAndEnterpriseId(@Param("userId") String userId, TabHaobanStaff selectByUserIdAndEnterpriseId(@Param("userId") String userId,
@Param("wxEnterpriseId") String wxEnterpriseId); @Param("wxEnterpriseId") String wxEnterpriseId);
TabHaobanStaff selectSuperByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId); TabHaobanStaff selectSuperByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId);
List<TabHaobanStaff> listByPhoneNumber(@Param("phoneNumber") String phoneNumber); List<TabHaobanStaff> listByPhoneNumber(@Param("phoneNumber") String phoneNumber);
List<TabHaobanStaff> listByUserIdsAndWxEnterpriseId(@Param("userIds") List<String> userIds, @Param("wxEnterpriseId") String wxEnterpriseId); List<TabHaobanStaff> listByUserIdsAndWxEnterpriseId(@Param("userIds") List<String> userIds, @Param("wxEnterpriseId") String wxEnterpriseId);
int cleanStaff(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffIds") List<String> staffIds); int cleanStaff(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffIds") List<String> staffIds);
TabHaobanStaff getWxStaffByOne(@Param("wxEnterpriseId") String wxEnterpriseId); TabHaobanStaff getWxStaffByOne(@Param("wxEnterpriseId") String wxEnterpriseId);
List<String> listUserStaffId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffIds") List<String> staffIds); List<String> listUserStaffId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffIds") List<String> staffIds);
List<TabHaobanStaff> listNoStatusStaffIds(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffIds") List<String> staffIds); List<TabHaobanStaff> listNoStatusStaffIds(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffIds") List<String> staffIds);
TabHaobanStaff getNoStatusByWxUserIds(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("wxUserId") String wxUserId); TabHaobanStaff getNoStatusByWxUserIds(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("wxUserId") String wxUserId);
/** /**
* 通过开放用户id和wx企业id列表 * 通过开放用户id和wx企业id列表
* *
* @param openUserIds 开放的用户id * @param openUserIds 开放的用户id
* @param wxEnterpriseId wx企业标识 * @param wxEnterpriseId wx企业标识
* @return {@link List<TabHaobanStaff> } * @return {@link List<TabHaobanStaff> }
* @author mozhu * @author mozhu
* @date 2021-12-21 16:35:35 * @date 2021-12-21 16:35:35
*/ */
List<TabHaobanStaff> listByOpenUserIdsAndWxEnterpriseId(@Param("openUserIds") List<String> openUserIds, List<TabHaobanStaff> listByOpenUserIdsAndWxEnterpriseId(@Param("openUserIds") List<String> openUserIds,
@Param("wxEnterpriseId") String wxEnterpriseId); @Param("wxEnterpriseId") String wxEnterpriseId);
/** /**
* 用户id wx企业id列表 * 用户id wx企业id列表
* *
* @param wxEnterpriseId wx企业标识 * @param wxEnterpriseId wx企业标识
* @return {@link List<String> } * @return {@link List<String> }
* @author mozhu * @author mozhu
* @date 2021-12-21 17:05:58 * @date 2021-12-21 17:05:58
*/ */
List<TabHaobanStaff> listUserIdByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId); List<TabHaobanStaff> listUserIdByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId);
/** /**
* 更新开放用户id,用户id * 更新开放用户id,用户id
* *
* @param wxEnterpriseId wx企业标识 * @param wxEnterpriseId wx企业标识
* @param wxUserId wx用户id * @param wxUserId wx用户id
* @param wxOpenUseId 开放的用户id * @param wxOpenUseId 开放的用户id
* @return int * @return int
* @author mozhu * @author mozhu
* @date 2021-12-21 17:17:51 * @date 2021-12-21 17:17:51
*/ */
int updateOpenUserIdsByUserId(@Param("wxEnterpriseId") String wxEnterpriseId, int updateOpenUserIdsByUserId(@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("wxUserId") String wxUserId, @Param("wxUserId") String wxUserId,
@Param("wxOpenUseId") String wxOpenUseId); @Param("wxOpenUseId") String wxOpenUseId);
/** /**
* 选择通过打开用户id和企业标识 * 选择通过打开用户id和企业标识
* *
* @param wxOpenUseId wx开放使用id * @param wxOpenUseId wx开放使用id
* @param wxEnterpriseId wx企业标识 * @param wxEnterpriseId wx企业标识
* @return {@link TabHaobanStaff } * @return {@link TabHaobanStaff }
* @author mozhu * @author mozhu
* @date 2021-12-21 21:13:56 * @date 2021-12-21 21:13:56
*/ */
TabHaobanStaff selectByOpenUserIdAndEnterpriseId(@Param("wxOpenUseId") String wxOpenUseId, TabHaobanStaff selectByOpenUserIdAndEnterpriseId(@Param("wxOpenUseId") String wxOpenUseId,
@Param("wxEnterpriseId") String wxEnterpriseId); @Param("wxEnterpriseId") String wxEnterpriseId);
/** /**
* 更新开放id员工id * 更新开放id员工id
* *
* @param staffId 员工id * @param staffId 员工id
* @param openId 开放id * @param openId 开放id
* @return int * @return int
*/ */
int updateOpenIdByStaffId(@Param("staffId") String staffId, @Param("openId") String openId); int updateOpenIdByStaffId(@Param("staffId") String staffId, @Param("openId") String openId);
/** /**
* 更新二维码通过员工id * 更新二维码通过员工id
* *
* @param staffId 员工id * @param staffId 员工id
* @param qrCode 二维码 * @param qrCode 二维码
* @return int * @return int
*/ */
int updateQrCodeByStaffId(@Param("staffId") String staffId, @Param("qrCode") String qrCode); int updateQrCodeByStaffId(@Param("staffId") String staffId, @Param("qrCode") String qrCode);
/** /**
* 选择电话号码和企业标识 * 选择电话号码和企业标识
* *
* @param phoneNumber 电话号码 * @param phoneNumber 电话号码
* @param wxEnterpriseId wx企业标识 * @param wxEnterpriseId wx企业标识
* @return {@link TabHaobanStaff } * @return {@link TabHaobanStaff }
* @author mozhu * @author mozhu
* @date 2022-01-12 17:20:16 * @date 2022-01-12 17:20:16
*/ */
TabHaobanStaff selectByPhoneNumberAndEnterpriseId(@Param("phoneNumber") String phoneNumber, TabHaobanStaff selectByPhoneNumberAndEnterpriseId(@Param("phoneNumber") String phoneNumber,
@Param("wxEnterpriseId") String wxEnterpriseId); @Param("wxEnterpriseId") String wxEnterpriseId);
/**
* 删除除了当前staffId以外其他的staff /**
* * 删除同wxUserId的其他staff
* @param staffId staffId *
* @param wxEnterpriseId wx企业标识 * @param wxUserId 微信用户id
* @param wxUserId wx用户id * @param staffId 导购id
*/ * @param wxEnterpriseId wx企业标识
void delOtherStaff(@Param("staffId")String staffId, */
@Param("wxEnterpriseId")String wxEnterpriseId, void delOtherStaffByWxUserId(@Param("wxUserId") String wxUserId,
@Param("wxUserId")String wxUserId); @Param("staffId") String staffId,
@Param("wxEnterpriseId") String wxEnterpriseId);
} }
\ No newline at end of file
...@@ -97,13 +97,12 @@ public interface StaffService { ...@@ -97,13 +97,12 @@ public interface StaffService {
*/ */
int updateOpenUserIdsByUserId(String wxEnterpriseId, String wxUserId, String wxOpenUseId); int updateOpenUserIdsByUserId(String wxEnterpriseId, String wxUserId, String wxOpenUseId);
/** /**
* 删除除了当前staffId以外其他的staff * 删除同wxUserId的其他staff
* *
* @param staffId staffId * @param wxUserId 微信用户id
* @param staffId 导购id
* @param wxEnterpriseId wx企业标识 * @param wxEnterpriseId wx企业标识
* @param wxUserId wx用户id
*/ */
void delOtherStaff(String staffId, String wxEnterpriseId, String wxUserId); void delOtherStaffByWxUserId(String wxUserId, String staffId, String wxEnterpriseId);
} }
...@@ -121,11 +121,8 @@ public class StaffServiceImpl implements StaffService { ...@@ -121,11 +121,8 @@ public class StaffServiceImpl implements StaffService {
} }
@Override @Override
public void delOtherStaff(String staffId, String wxEnterpriseId, String wxUserId) { public void delOtherStaffByWxUserId(String wxUserId, String staffId, String wxEnterpriseId) {
if (StringUtils.isEmpty(staffId)){ mapper.delOtherStaffByWxUserId(wxUserId, staffId, wxEnterpriseId);
return;
}
mapper.delOtherStaff(staffId, wxEnterpriseId, wxUserId);
} }
} }
...@@ -25,6 +25,7 @@ import com.gic.wechat.api.dto.qywx.ItemDTO; ...@@ -25,6 +25,7 @@ import com.gic.wechat.api.dto.qywx.ItemDTO;
import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO; import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
import com.gic.wechat.api.service.qywx.QywxDepartmentApiService; import com.gic.wechat.api.service.qywx.QywxDepartmentApiService;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService; import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.google.common.collect.Sets;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
...@@ -133,6 +134,12 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -133,6 +134,12 @@ public class MessageApiServiceImpl implements MessageApiService {
log.info("通过corpId:【{}】未查询到授权企业,无法处理", dto.getAuthCorpId()); log.info("通过corpId:【{}】未查询到授权企业,无法处理", dto.getAuthCorpId());
return; return;
} }
// 校验适用企业
boolean suitWxEnterpriseIid = checkSuitEnterpriseId(enterprise.getWxEnterpriseId());
if (!suitWxEnterpriseIid) {
log.info("微信企业id:{}, 不适用", enterprise.getWxEnterpriseId());
return;
}
List<TabHaobanWxEnterpriseRelated> relatedList = wxEnterpriseRelatedService.getByWxEnterpriseId(enterprise.getWxEnterpriseId()); List<TabHaobanWxEnterpriseRelated> relatedList = wxEnterpriseRelatedService.getByWxEnterpriseId(enterprise.getWxEnterpriseId());
if (CollectionUtils.isEmpty(relatedList)) { if (CollectionUtils.isEmpty(relatedList)) {
log.info("未查询到企业关联企业 wxEnt"); log.info("未查询到企业关联企业 wxEnt");
...@@ -189,6 +196,11 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -189,6 +196,11 @@ public class MessageApiServiceImpl implements MessageApiService {
return userid.startsWith("5"); return userid.startsWith("5");
} }
private boolean checkSuitEnterpriseId(String wxEnterpriseId) {
Set<String> wxSet = Sets.newHashSet("ca66a01b79474c40b3e7c7f93daf1a3b");
return wxSet.contains(wxEnterpriseId);
}
private void doDealUser(QywxCallBackDTO dto, String enterpriseId, String secret) { private void doDealUser(QywxCallBackDTO dto, String enterpriseId, String secret) {
ClerkQwDTO clerkQwDTO = new ClerkQwDTO(); ClerkQwDTO clerkQwDTO = new ClerkQwDTO();
clerkQwDTO.setEnterpriseId(enterpriseId); clerkQwDTO.setEnterpriseId(enterpriseId);
......
...@@ -390,9 +390,8 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -390,9 +390,8 @@ public class StaffApiServiceImpl implements StaffApiService {
String nationCode = arr[0]; String nationCode = arr[0];
String phoneNumber = arr[1]; String phoneNumber = arr[1];
TabHaobanStaff staff = staffService.selectByPhoneNumberAndEnterpriseId(phoneNumber.trim(), wxEnterpriseId); TabHaobanStaff staff = staffService.selectByPhoneNumberAndEnterpriseId(phoneNumber.trim(), wxEnterpriseId);
if (staff != null) { if (staff != null){
//兼容导购调整手机号逻辑-该方法强行保证一个导购只存在一条有效导购数据 staffService.delOtherStaffByWxUserId(staff.getWxUserId(),staff.getStaffId(), wxEnterpriseId);
staffService.delOtherStaff(staff.getStaffId(),staff.getWxEnterpriseId(),staff.getWxUserId());
} }
staff = (staff == null ? new TabHaobanStaff() : staff); staff = (staff == null ? new TabHaobanStaff() : staff);
staff.setWxUserId(userId); staff.setWxUserId(userId);
......
...@@ -43,9 +43,9 @@ ...@@ -43,9 +43,9 @@
where staff_id = #{staffId,jdbcType=VARCHAR} where staff_id = #{staffId,jdbcType=VARCHAR}
</delete> </delete>
<update id="delOtherStaff"> <update id="delOtherStaffByWxUserId">
update tab_haoban_staff update tab_haoban_staff
set status_flag = 0 set status_flag = 0,update_time = now()
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
and wx_user_id = #{wxUserId} and wx_user_id = #{wxUserId}
and status_flag = 1 and status_flag = 1
...@@ -469,4 +469,22 @@ ...@@ -469,4 +469,22 @@
and status_flag = 1 limit 1 and status_flag = 1 limit 1
</select> </select>
<update id="delStaffByWxUserId">
update tab_haoban_staff
set status_flag = 0,update_time = now()
where wx_enterprise_id = #{wxEnterpriseId}
and wx_user_id = #{wxUserId}
and status_flag = 1
and staff_id != #{staffId}
</update>
<update id="delStaffByPhoneNumber">
update tab_haoban_staff
set status_flag = 0,update_time = now()
where wx_enterprise_id = #{wxEnterpriseId}
and phone_number = #{phoneNumber}
and status_flag = 1
and staff_id != #{staffId}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
from tab_haoban_friend_setting from tab_haoban_friend_setting
limit #{offset}, #{limit} limit #{offset}, #{limit}
</select> </select>
<select id="getByWxEnterpriseId" resultType="com.gic.haoban.manage.service.entity.TabHaobanFriendSetting"> <select id="getByWxEnterpriseId" resultMap="TabHaobanFriendSettingMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_friend_setting where wx_enterprise_id = #{wxEnterpriseId} and delete_flag = 0 from tab_haoban_friend_setting where wx_enterprise_id = #{wxEnterpriseId} and delete_flag = 0
......
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import com.gic.api.base.commons.Constant;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse; import com.gic.commons.webapi.reponse.RestResponse;
...@@ -15,9 +16,11 @@ import com.gic.haoban.manage.api.service.out.WelcomeApiService; ...@@ -15,9 +16,11 @@ import com.gic.haoban.manage.api.service.out.WelcomeApiService;
import com.gic.haoban.manage.web.qo.welcome.ListWelcomeQO; import com.gic.haoban.manage.web.qo.welcome.ListWelcomeQO;
import com.gic.haoban.manage.web.qo.welcome.SaveFriendSettingQO; import com.gic.haoban.manage.web.qo.welcome.SaveFriendSettingQO;
import com.gic.haoban.manage.web.qo.welcome.SaveWelcomeQO; import com.gic.haoban.manage.web.qo.welcome.SaveWelcomeQO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List; import java.util.List;
/** /**
...@@ -42,7 +45,7 @@ public class WelcomeController extends WebBaseController { ...@@ -42,7 +45,7 @@ public class WelcomeController extends WebBaseController {
* @date : 2022/2/11 * @date : 2022/2/11
*/ */
@RequestMapping(value = "/save", method = RequestMethod.POST) @RequestMapping(value = "/save", method = RequestMethod.POST)
public RestResponse<Boolean> saveWelcome(@RequestBody SaveWelcomeQO qo) { public RestResponse<Boolean> saveWelcome(@RequestBody @Valid SaveWelcomeQO qo) {
WebLoginDTO login = AuthWebRequestUtil.getLoginUser(); WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
SaveWelcomeQDTO qdto = new SaveWelcomeQDTO(); SaveWelcomeQDTO qdto = new SaveWelcomeQDTO();
qdto.setWelcomeId(qo.getWelcomeId()); qdto.setWelcomeId(qo.getWelcomeId());
...@@ -69,6 +72,9 @@ public class WelcomeController extends WebBaseController { ...@@ -69,6 +72,9 @@ public class WelcomeController extends WebBaseController {
*/ */
@RequestMapping(value = "/remove", method = RequestMethod.GET) @RequestMapping(value = "/remove", method = RequestMethod.GET)
public RestResponse<Boolean> removeWelcome(@RequestParam("welcomeId") String welcomeId) { public RestResponse<Boolean> removeWelcome(@RequestParam("welcomeId") String welcomeId) {
if (StringUtils.isEmpty(welcomeId)) {
RestResponse.failure(Constant.STRING_1, "欢迎语id为空", Boolean.FALSE);
}
ServiceResponse<Boolean> response = welcomeApiService.removeWelcome(welcomeId); ServiceResponse<Boolean> response = welcomeApiService.removeWelcome(welcomeId);
return RestResponse.successResult(response.getResult()); return RestResponse.successResult(response.getResult());
} }
...@@ -82,7 +88,7 @@ public class WelcomeController extends WebBaseController { ...@@ -82,7 +88,7 @@ public class WelcomeController extends WebBaseController {
* @date : 2022/2/11 * @date : 2022/2/11
*/ */
@RequestMapping(value = "/list", method = RequestMethod.POST) @RequestMapping(value = "/list", method = RequestMethod.POST)
public RestResponse<List<WelcomeListDTO>> listWelcome(@RequestBody ListWelcomeQO qo) { public RestResponse<List<WelcomeListDTO>> listWelcome(@RequestBody @Valid ListWelcomeQO qo) {
ServiceResponse<List<WelcomeListDTO>> response = welcomeApiService.listWelcome(qo.getWxEnterpriseId(), qo.getTitle()); ServiceResponse<List<WelcomeListDTO>> response = welcomeApiService.listWelcome(qo.getWxEnterpriseId(), qo.getTitle());
return RestResponse.successResult(response.getResult()); return RestResponse.successResult(response.getResult());
} }
...@@ -97,6 +103,9 @@ public class WelcomeController extends WebBaseController { ...@@ -97,6 +103,9 @@ public class WelcomeController extends WebBaseController {
*/ */
@RequestMapping(value = "/get", method = RequestMethod.GET) @RequestMapping(value = "/get", method = RequestMethod.GET)
public RestResponse<WelcomeDetailDTO> getWelcome(@RequestParam("welcomeId") String welcomeId) { public RestResponse<WelcomeDetailDTO> getWelcome(@RequestParam("welcomeId") String welcomeId) {
if (StringUtils.isEmpty(welcomeId)) {
RestResponse.failure(Constant.STRING_1, "欢迎语id为空");
}
ServiceResponse<WelcomeDetailDTO> response = welcomeApiService.getWelcome(welcomeId); ServiceResponse<WelcomeDetailDTO> response = welcomeApiService.getWelcome(welcomeId);
return RestResponse.successResult(response.getResult()); return RestResponse.successResult(response.getResult());
} }
...@@ -110,7 +119,7 @@ public class WelcomeController extends WebBaseController { ...@@ -110,7 +119,7 @@ public class WelcomeController extends WebBaseController {
* @date : 2022/2/11 * @date : 2022/2/11
*/ */
@RequestMapping(value = "/save/friend-setting", method = RequestMethod.POST) @RequestMapping(value = "/save/friend-setting", method = RequestMethod.POST)
public RestResponse<Boolean> saveFriendSetting(@RequestBody SaveFriendSettingQO qo) { public RestResponse<Boolean> saveFriendSetting(@RequestBody @Valid SaveFriendSettingQO qo) {
WebLoginDTO login = AuthWebRequestUtil.getLoginUser(); WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
SaveFriendSettingQDTO qdto = EntityUtil.changeEntityNew(SaveFriendSettingQDTO.class, qo); SaveFriendSettingQDTO qdto = EntityUtil.changeEntityNew(SaveFriendSettingQDTO.class, qo);
qdto.setUpdateId(login.getStaffDTO().getStaffId()); qdto.setUpdateId(login.getStaffDTO().getStaffId());
...@@ -129,6 +138,9 @@ public class WelcomeController extends WebBaseController { ...@@ -129,6 +138,9 @@ public class WelcomeController extends WebBaseController {
*/ */
@RequestMapping(value = "/get/friend-setting", method = RequestMethod.GET) @RequestMapping(value = "/get/friend-setting", method = RequestMethod.GET)
public RestResponse<FriendSettingDetailDTO> getFriendSetting(@RequestParam("wxEnterpriseId") String wxEnterpriseId) { public RestResponse<FriendSettingDetailDTO> getFriendSetting(@RequestParam("wxEnterpriseId") String wxEnterpriseId) {
if (StringUtils.isEmpty(wxEnterpriseId)) {
RestResponse.failure(Constant.STRING_1, "微信企业id为空", Boolean.FALSE);
}
ServiceResponse<FriendSettingDetailDTO> response = welcomeApiService.getFriendSetting(wxEnterpriseId); ServiceResponse<FriendSettingDetailDTO> response = welcomeApiService.getFriendSetting(wxEnterpriseId);
return RestResponse.successResult(response.getResult()); return RestResponse.successResult(response.getResult());
} }
......
package com.gic.haoban.manage.web.qo.welcome; package com.gic.haoban.manage.web.qo.welcome;
import org.hibernate.validator.constraints.NotEmpty;
import java.io.Serializable; import java.io.Serializable;
/** /**
...@@ -14,6 +16,7 @@ public class ListWelcomeQO implements Serializable { ...@@ -14,6 +16,7 @@ public class ListWelcomeQO implements Serializable {
/** /**
* 微信企业id * 微信企业id
*/ */
@NotEmpty(message = "微信企业id不能为空")
private String wxEnterpriseId; private String wxEnterpriseId;
/** /**
* 标题 * 标题
......
package com.gic.haoban.manage.web.qo.welcome; package com.gic.haoban.manage.web.qo.welcome;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
/** /**
...@@ -17,6 +20,7 @@ public class SaveFriendSettingQO implements Serializable { ...@@ -17,6 +20,7 @@ public class SaveFriendSettingQO implements Serializable {
/** /**
* 微信企业id * 微信企业id
*/ */
@NotEmpty(message = "微信企业id不能为空")
private String wxEnterpriseId; private String wxEnterpriseId;
/** /**
* 欢迎语配置类型 : * 欢迎语配置类型 :
...@@ -25,6 +29,7 @@ public class SaveFriendSettingQO implements Serializable { ...@@ -25,6 +29,7 @@ public class SaveFriendSettingQO implements Serializable {
* 3 发送好办欢迎语文案 * 3 发送好办欢迎语文案
* 4 不发送好办欢迎语,用企微欢迎语 * 4 不发送好办欢迎语,用企微欢迎语
*/ */
@NotNull(message = "加好友配置类型不能为空")
private Integer friendSettingType; private Integer friendSettingType;
public Long getFriendSettingId() { public Long getFriendSettingId() {
......
...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.web.qo.welcome; ...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.web.qo.welcome;
import com.gic.haoban.manage.api.dto.welcome.dto.WelcomeSuitDepartmentDTO; import com.gic.haoban.manage.api.dto.welcome.dto.WelcomeSuitDepartmentDTO;
import com.gic.haoban.manage.api.dto.welcome.dto.WelcomeSuitStaffDTO; import com.gic.haoban.manage.api.dto.welcome.dto.WelcomeSuitStaffDTO;
import org.hibernate.validator.constraints.NotEmpty;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
...@@ -21,14 +22,17 @@ public class SaveWelcomeQO implements Serializable { ...@@ -21,14 +22,17 @@ public class SaveWelcomeQO implements Serializable {
/** /**
* 微信企业id * 微信企业id
*/ */
@NotEmpty(message = "微信企业id不能为空")
private String wxEnterpriseId; private String wxEnterpriseId;
/** /**
* 标题 * 标题
*/ */
@NotEmpty(message = "标题不能为空")
private String title; private String title;
/** /**
* 内容 * 内容
*/ */
@NotEmpty(message = "内容不能为空")
private String welcomeContent; private String welcomeContent;
/** /**
* 媒体列表 * 媒体列表
......
...@@ -102,7 +102,7 @@ public class ClerkController extends WebBaseController { ...@@ -102,7 +102,7 @@ public class ClerkController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_2); return resultResponse(HaoBanErrCode.ERR_2);
} }
List<StaffClerkRelationDTO> list = staffClerkRelationApiService.listByStoreId(storeId); List<StaffClerkRelationDTO> list = staffClerkRelationApiService.listByStoreId(storeId);
List<String> staffIds = list.stream().map(s -> s.getStaffId()).collect(Collectors.toList()); List<String> staffIds = list.stream().map(StaffClerkRelationDTO::getStaffId).collect(Collectors.toList());
List<StaffDTO> resultlist = staffApiService.listByIds(staffIds); List<StaffDTO> resultlist = staffApiService.listByIds(staffIds);
Map<String, StaffDTO> map = com.gic.commons.util.CollectionUtil.toMap(resultlist, "staffId"); Map<String, StaffDTO> map = com.gic.commons.util.CollectionUtil.toMap(resultlist, "staffId");
......
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