Commit d9574d9b by 墨竹

fix:返回错误码修改

parent a28e277f
...@@ -4,6 +4,7 @@ import com.gic.api.base.commons.Page; ...@@ -4,6 +4,7 @@ import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO; import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO; import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO; import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeClerkBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO; import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO;
import java.util.List; import java.util.List;
...@@ -176,4 +177,7 @@ public interface HmQrcodeService { ...@@ -176,4 +177,7 @@ public interface HmQrcodeService {
int batchUpdateQrcodeGroup(List<Long> hmIds, Long groupId); int batchUpdateQrcodeGroup(List<Long> hmIds, Long groupId);
int getCanAddCount(String wxEnterpriseId , String enterpriseId , String clerkId) ; int getCanAddCount(String wxEnterpriseId , String enterpriseId , String clerkId) ;
List<HmQrcodeClerkBO> listCanAddClerk(String wxEnterpriseId , String enterpriseId , String clerkId) ;
} }
package com.gic.haoban.manage.service.service.hm.impl; package com.gic.haoban.manage.service.service.hm.impl;
import java.util.Date;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.haoban.common.utils.PageUtil; import com.gic.haoban.common.utils.PageUtil;
...@@ -22,6 +14,13 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO; ...@@ -22,6 +14,13 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO;
import com.gic.haoban.manage.service.service.hm.HmQrcodeService; import com.gic.haoban.manage.service.service.hm.HmQrcodeService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/** /**
* 活码(TabHaobanHmQrcode)表服务实现类 * 活码(TabHaobanHmQrcode)表服务实现类
...@@ -155,6 +154,7 @@ public class HmQrcodeServiceImpl implements HmQrcodeService { ...@@ -155,6 +154,7 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
return count; return count;
} }
@Override
public List<HmQrcodeClerkBO> listCanAddClerk(String wxEnterpriseId, String enterprsieId, String clerkId) { public List<HmQrcodeClerkBO> listCanAddClerk(String wxEnterpriseId, String enterprsieId, String clerkId) {
List<String> authStoreIdList = this.staffApiService.getHaoBanStoreIdsRolesByClerkId(clerkId, wxEnterpriseId); List<String> authStoreIdList = this.staffApiService.getHaoBanStoreIdsRolesByClerkId(clerkId, wxEnterpriseId);
if (CollectionUtils.isEmpty(authStoreIdList)) { if (CollectionUtils.isEmpty(authStoreIdList)) {
......
...@@ -25,12 +25,8 @@ import com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType; ...@@ -25,12 +25,8 @@ import com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService; import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.entity.TabHaobanStaff; import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.pojo.bo.hm.HmClerkRelationBO; import com.gic.haoban.manage.service.pojo.bo.hm.*;
import com.gic.haoban.manage.service.pojo.bo.hm.HmGroupSettingBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmWelcomeRelationBO;
import com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeDetailBO; import com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeDetailBO;
import com.gic.haoban.manage.service.service.StaffClerkRelationService; import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.haoban.manage.service.service.StaffService; import com.gic.haoban.manage.service.service.StaffService;
...@@ -181,19 +177,20 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -181,19 +177,20 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
logger.error("未查询到微信企业"); logger.error("未查询到微信企业");
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "微信企业不存在"); return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "微信企业不存在");
} }
String enterpriseId = hmQrcodeQDTO.getEnterpriseId();
List<String> clerkIdList = hmQrcodeQDTO.getClerkIdList(); List<String> clerkIdList = hmQrcodeQDTO.getClerkIdList();
if (CollectionUtils.isEmpty(clerkIdList)) { if (CollectionUtils.isEmpty(clerkIdList)) {
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_5.getCode()), "导购不允许为空"); return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_5.getCode()), "导购不允许为空");
} }
if (clerkIdList.contains("-1")) { if (clerkIdList.contains("-1")) {
List<TabHaobanStaffClerkRelation> tabHaobanStaffClerkRelations = staffClerkRelationService.listByWxEnterpriseId(wxEnterpriseId); List<HmQrcodeClerkBO> hmQrcodeClerkBOS = hmQrcodeService.listCanAddClerk(wxEnterpriseId, enterpriseId, hmQrcodeQDTO.getCreatorId());
clerkIdList = tabHaobanStaffClerkRelations.stream().map(TabHaobanStaffClerkRelation::getClerkId).collect(Collectors.toList()); clerkIdList = hmQrcodeClerkBOS.stream().map(HmQrcodeClerkBO::getClerkId).collect(Collectors.toList());
} }
for (String clerkId : clerkIdList) { for (String clerkId : clerkIdList) {
hmQrcodeQDTO.setClerkIdList(Collections.singletonList(clerkId)); hmQrcodeQDTO.setClerkIdList(Collections.singletonList(clerkId));
add(hmQrcodeQDTO); add(hmQrcodeQDTO);
} }
setLoggerContext(hmQrcodeQDTO.getEnterpriseId(), wxEnterpriseId, hmQrcodeQDTO.getCreatorId(), hmQrcodeQDTO.getCreatorName()); setLoggerContext(enterpriseId, wxEnterpriseId, hmQrcodeQDTO.getCreatorId(), hmQrcodeQDTO.getCreatorName());
GicLogRecordEvaluationContext.putAttribute("logContent", "【" + "批量创建数量" + clerkIdList.size() + "】"); GicLogRecordEvaluationContext.putAttribute("logContent", "【" + "批量创建数量" + clerkIdList.size() + "】");
return ServiceResponse.success(); return ServiceResponse.success();
} }
......
...@@ -299,7 +299,7 @@ ...@@ -299,7 +299,7 @@
select select
<include refid="Base_Column_List"></include> <include refid="Base_Column_List"></include>
from tab_haoban_hm_qrcode from tab_haoban_hm_qrcode
where clerk_id = #{clerkId} and status_flag in (1,3) and wx_enterprise_id = #{wxEnterpriseId} where clerk_id = #{clerkId} and status_flag in (1,3) and wx_enterprise_id = #{wxEnterpriseId} limit 1
</select> </select>
<select id="queryByClerkIdAndOverFlag" resultMap="TabHaobanHmQrcodeMap"> <select id="queryByClerkIdAndOverFlag" resultMap="TabHaobanHmQrcodeMap">
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
<include refid="Base_Column_List"></include> <include refid="Base_Column_List"></include>
from tab_haoban_hm_qrcode from tab_haoban_hm_qrcode
where clerk_id = #{clerkId} and status_flag = 1 where clerk_id = #{clerkId} and status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId} and over_flag = #{overFlag} and wx_enterprise_id = #{wxEnterpriseId} and over_flag = #{overFlag} limit 1
</select> </select>
......
package com.gic.haoban.manage.web.controller.hm; package com.gic.haoban.manage.web.controller.hm;
import java.util.ArrayList; import cn.hutool.core.convert.Convert;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.BasePageInfo; import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
...@@ -20,12 +10,7 @@ import com.gic.commons.webapi.reponse.RestResponse; ...@@ -20,12 +10,7 @@ import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO; import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil; import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.manage.api.constants.StatisticsApolloKeyConstant; import com.gic.haoban.manage.api.constants.StatisticsApolloKeyConstant;
import com.gic.haoban.manage.api.dto.hm.HmClerkDTO; import com.gic.haoban.manage.api.dto.hm.*;
import com.gic.haoban.manage.api.dto.hm.HmClerkRelationDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeListDTO;
import com.gic.haoban.manage.api.dto.hm.HmStoreDTO;
import com.gic.haoban.manage.api.dto.hm.WxUserAddLogDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO; import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.WxUserAddLogSearchQDTO; import com.gic.haoban.manage.api.dto.qdto.hm.WxUserAddLogSearchQDTO;
import com.gic.haoban.manage.api.dto.statistics.StatisticsDTO; import com.gic.haoban.manage.api.dto.statistics.StatisticsDTO;
...@@ -43,8 +28,16 @@ import com.gic.haoban.manage.web.qo.hm.data.HmQrcodeListQO; ...@@ -43,8 +28,16 @@ import com.gic.haoban.manage.web.qo.hm.data.HmQrcodeListQO;
import com.gic.haoban.manage.web.qo.hm.data.HmTrendQO; import com.gic.haoban.manage.web.qo.hm.data.HmTrendQO;
import com.gic.haoban.manage.web.vo.hm.HmDetailClerkListVO; import com.gic.haoban.manage.web.vo.hm.HmDetailClerkListVO;
import com.gic.haoban.manage.web.vo.hm.HmTrendVO; import com.gic.haoban.manage.web.vo.hm.HmTrendVO;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import cn.hutool.core.convert.Convert; import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/** /**
* 活码(TabHaobanHmQrcode)表控制层 * 活码(TabHaobanHmQrcode)表控制层
...@@ -80,7 +73,7 @@ public class HmQrcodeController { ...@@ -80,7 +73,7 @@ public class HmQrcodeController {
hmQrcodeQDTO.setEnterpriseId(loginUser.getEnterpriseId()); hmQrcodeQDTO.setEnterpriseId(loginUser.getEnterpriseId());
ServiceResponse serviceResponse = this.hmQrcodeApiService.add(hmQrcodeQDTO); ServiceResponse serviceResponse = this.hmQrcodeApiService.add(hmQrcodeQDTO);
if (!"0000".equals(serviceResponse.getCode())) { if (!"0000".equals(serviceResponse.getCode())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_0.getCode()),serviceResponse.getMessage()); return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_DEFINE.getCode()),serviceResponse.getMessage());
} }
return RestResponse.successResult(); return RestResponse.successResult();
} }
...@@ -96,7 +89,7 @@ public class HmQrcodeController { ...@@ -96,7 +89,7 @@ public class HmQrcodeController {
hmQrcodeQDTO.setEnterpriseId(loginUser.getEnterpriseId()); hmQrcodeQDTO.setEnterpriseId(loginUser.getEnterpriseId());
ServiceResponse serviceResponse = this.hmQrcodeApiService.addList(hmQrcodeQDTO); ServiceResponse serviceResponse = this.hmQrcodeApiService.addList(hmQrcodeQDTO);
if (!"0000".equals(serviceResponse.getCode())) { if (!"0000".equals(serviceResponse.getCode())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_0.getCode()),serviceResponse.getMessage()); return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_DEFINE.getCode()),serviceResponse.getMessage());
} }
return RestResponse.successResult(); return RestResponse.successResult();
} }
...@@ -115,7 +108,7 @@ public class HmQrcodeController { ...@@ -115,7 +108,7 @@ public class HmQrcodeController {
hmQrcodeQDTO.setEnterpriseId(loginUser.getEnterpriseId()); hmQrcodeQDTO.setEnterpriseId(loginUser.getEnterpriseId());
ServiceResponse serviceResponse = this.hmQrcodeApiService.update(hmQrcodeQDTO); ServiceResponse serviceResponse = this.hmQrcodeApiService.update(hmQrcodeQDTO);
if (!"0000".equals(serviceResponse.getCode())) { if (!"0000".equals(serviceResponse.getCode())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_0.getCode()),serviceResponse.getMessage()); return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_DEFINE.getCode()),serviceResponse.getMessage());
} }
return RestResponse.successResult(); return RestResponse.successResult();
} }
...@@ -204,7 +197,7 @@ public class HmQrcodeController { ...@@ -204,7 +197,7 @@ public class HmQrcodeController {
public RestResponse del(Long hmId) { public RestResponse del(Long hmId) {
ServiceResponse serviceResponse = this.hmQrcodeApiService.delById(hmId); ServiceResponse serviceResponse = this.hmQrcodeApiService.delById(hmId);
if (!"0000".equals(serviceResponse.getCode())) { if (!"0000".equals(serviceResponse.getCode())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_0.getCode()),serviceResponse.getMessage()); return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_DEFINE.getCode()),serviceResponse.getMessage());
} }
return RestResponse.successResult(); return RestResponse.successResult();
} }
......
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