Commit a218fffb by qwmqiuwenmin

fix

parent cc6f74aa
......@@ -27,4 +27,8 @@ public interface AuditApiService {
AuditDTO findByStoreIdAndChangeField(String storeId,String changeField);
void insert(AuditDTO audit);
Page<AuditDTO> listByStaffId(String staffId, BasePageInfo pageInfo);
Page<AuditDTO> pageStoreListByParams(String storeId, BasePageInfo pageInfo, Integer auditType, Integer auditStatus);
}
......@@ -9,4 +9,6 @@ public interface StaffClerkRelationApiService {
List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList);
List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId);
}
......@@ -28,4 +28,8 @@ public interface TabHaobanAuditMapper {
List<TabHaobanAudit> listByStoreId(String storeId);
TabHaobanAudit findByStoreIdAndChangeField(@Param("storeId")String storeId,@Param("changeField")String changeField);
com.github.pagehelper.Page listByStaffId(@Param("staffId")String staffId);
com.github.pagehelper.Page pageStoreListByParams(@Param("storeId")String storeId, @Param("auditType")Integer auditType, @Param("auditStatus")Integer auditStatus);
}
\ No newline at end of file
......@@ -21,4 +21,6 @@ public interface TabHaobanStaffClerkRelationMapper {
int updateByPrimaryKey(TabHaobanStaffClerkRelation record);
List<TabHaobanStaffClerkRelation> listBindCode(@Param("enterpriseId")String enterpriseId, @Param("clerkCodeList")Set<String> clerkCodeList);
List<TabHaobanStaffClerkRelation> listBindCodeByStaffId(@Param("enterpriseIdList")List<String> enterpriseIdList, @Param("staffId")String staffId);
}
\ No newline at end of file
......@@ -9,4 +9,6 @@ public interface StaffClerkRelationService {
List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList);
List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId);
}
......@@ -20,5 +20,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
public List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList) {
return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, mapper.listBindCode(enterpriseId,clerkCodeList));
}
@Override
public List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId) {
return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, mapper.listBindCodeByStaffId(enterpriseIdList,staffId));
}
}
......@@ -27,6 +27,7 @@ import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.dto.StoreDetailDTO;
import com.gic.enterprise.api.dto.StorePhotoDTO;
import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.app.customer.dto.MessageLogDTO;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.common.utils.UuidUtil;
......@@ -333,4 +334,15 @@ public class AuditApiServiceImpl implements AuditApiService{
audit.setUpdateTime(new Date());
auditMapper.insertSelective(EntityUtil.changeEntityByJSON(TabHaobanAudit.class, audit));
}
@Override
public Page<AuditDTO> listByStaffId(String staffId, BasePageInfo pageInfo) {
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
return PageUtil.changePageHelperToCurrentPage(auditMapper.listByStaffId(staffId),AuditDTO.class);
}
@Override
public Page<AuditDTO> pageStoreListByParams(String storeId, BasePageInfo pageInfo, Integer auditType,
Integer auditStatus) {
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
return PageUtil.changePageHelperToCurrentPage(auditMapper.pageStoreListByParams(storeId,auditType,auditStatus),AuditDTO.class);
}
}
......@@ -19,5 +19,9 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
public List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList) {
return staffClerkRelatinService.listBindCode(enterpriseId,clerkCodeList);
}
@Override
public List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId) {
return staffClerkRelatinService.listBindCodeByStaffId(enterpriseIdList,staffId);
}
}
......@@ -355,4 +355,32 @@
and change_field = #{changeField,jdbcType=VARCHAR}
</select>
<select id="listByStaffId" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from tab_haoban_audit
where 1=1
and commit_staff_id = #{staffId,jdbcType=VARCHAR}
and status_flag = 1
and audit_type in (2,3,4,5)
order by create_time desc
</select>
<select id="pageStoreListByParams" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from tab_haoban_audit
where 1=1
and store_id = #{storeId,jdbcType=VARCHAR}
and status_flag = 1
<if test="auditType == null || auditType == -1">
and audit_type in (2,3,4,5)
</if>
<if test="auditType != null and auditType != -1">
and audit_type = #{auditType}
</if>
and audit_status = #{auditStatus}
order by create_time desc
</select>
</mapper>
\ No newline at end of file
......@@ -172,4 +172,16 @@
#{id,jdbcType=VARCHAR}
</foreach>
</select>
<select id="listBindCodeByStaffId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_relation
where staff_id = #{staffId,jdbcType=VARCHAR}
and status_flag = 1
and enterprise_id in
<foreach collection="enterpriseIdList" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</select>
</mapper>
\ No newline at end of file
package com.gic.haoban.manage.web.controller;
import java.util.ArrayList;
import java.util.List;
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.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.EntityUtil;
import com.gic.haoban.app.customer.dto.MessageLogDTO;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.PageResult2;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.AuditDTO;
import com.gic.haoban.manage.api.service.AuditApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.vo.AuditVO;
@RestController
public class AuditController extends WebBaseController{
private static Logger logger= LoggerFactory.getLogger(AuditController.class);
@Autowired
private AuditApiService auditApiService;
@RequestMapping("clerk-apply-list")
public HaobanResponse staffStoreList(String staffId,String wxEnterpriseId,BasePageInfo pageInfo){
if(StringUtils.isAnyBlank(staffId,wxEnterpriseId)){
return resultResponse(HaoBanErrCode.ERR_2);
}
Page<AuditDTO> page = auditApiService.listByStaffId(staffId,pageInfo);
List<AuditDTO> list = page.getResult();
List<AuditVO> voList = new ArrayList<AuditVO>();
for (AuditDTO auditDTO : list) {
AuditVO vo = EntityUtil.changeEntityByJSON(AuditVO.class, auditDTO);
String clerkCode = "";
String staffName = "";
String oldValue = auditDTO.getOldValue();
JSONObject json = JSON.parseObject(oldValue);
clerkCode = json.getString("clerkCode");
staffName = json.getString("staffName");
if(auditDTO.getAuditType() == 3){
vo.setCommitReason("添加导购账号:("+clerkCode+")");
}else if(auditDTO.getAuditType() == 4){
vo.setCommitReason("删除导购账号:("+clerkCode+")");
}else{
vo.setCommitReason("绑定申请{"+staffName+"}绑定登录导购code "+clerkCode);
}
voList.add(vo);
}
Page<AuditVO> pageVO = new Page<>();
pageVO.setCurrentPage(page.getCurrentPage());
pageVO.setPageSize(page.getPageSize());
pageVO.setResult(voList);
pageVO.setTotalCount(page.getTotalCount());
pageVO.setTotalPage(page.getTotalPage());
PageResult2 pageResult2 = PageUtil.getPageInfo(pageVO);
return resultResponse(HaoBanErrCode.ERR_1,pageResult2);
}
@RequestMapping("store-apply-list")
public HaobanResponse storeApplyList(String storeId,String wxEnterpriseId,BasePageInfo pageInfo,Integer auditType,Integer auditStatus){
if(StringUtils.isAnyBlank(storeId,wxEnterpriseId)){
return resultResponse(HaoBanErrCode.ERR_2);
}
Page<AuditDTO> page = auditApiService.pageStoreListByParams(storeId,pageInfo,auditType,auditStatus);
List<AuditDTO> list = page.getResult();
List<AuditVO> voList = new ArrayList<AuditVO>();
for (AuditDTO auditDTO : list) {
AuditVO vo = EntityUtil.changeEntityByJSON(AuditVO.class, auditDTO);
String clerkCode = "";
String staffName = "";
String oldValue = auditDTO.getOldValue();
JSONObject json = JSON.parseObject(oldValue);
clerkCode = json.getString("clerkCode");
staffName = json.getString("staffName");
if(auditDTO.getAuditType() == 3){
vo.setCommitReason("添加导购账号:("+clerkCode+")");
}else if(auditDTO.getAuditType() == 4){
vo.setCommitReason("删除导购账号:("+clerkCode+")");
}else if(auditDTO.getAuditType() == 5){
vo.setCommitReason("解除绑定:("+clerkCode+")");
}else{
vo.setCommitReason("绑定申请{"+staffName+"}绑定登录导购code "+clerkCode);
}
voList.add(vo);
}
Page<AuditVO> pageVO = new Page<>();
pageVO.setCurrentPage(page.getCurrentPage());
pageVO.setPageSize(page.getPageSize());
pageVO.setResult(voList);
pageVO.setTotalCount(page.getTotalCount());
pageVO.setTotalPage(page.getTotalPage());
PageResult2 pageResult2 = PageUtil.getPageInfo(pageVO);
return resultResponse(HaoBanErrCode.ERR_1,pageResult2);
}
}
......@@ -63,7 +63,7 @@ import com.google.i18n.phonenumbers.PhoneNumberUtil;
@RestController
public class ClerkController extends WebBaseController{
private static Logger logger= LoggerFactory.getLogger(WebInterceptor.class);
private static Logger logger= LoggerFactory.getLogger(ClerkController.class);
@Autowired
private ClerkService clerkService;
......@@ -84,10 +84,6 @@ public class ClerkController extends WebBaseController{
@Autowired
private DistributeApiService distributeApiService;
@Autowired
private QywxUserApiService qywxUserApiService;
@Autowired
private WxEnterpriseApiService wxEnterpriseApiService;
@Autowired
private MemberUnionidRelatedApiService memberUnionidRelatedApiService;
@Autowired
private WxEnterpriseRelatedApiService wxEnterpriseRelatedApiService;
......@@ -590,4 +586,24 @@ public class ClerkController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_10009);
}
@RequestMapping("staff-store-list")
public HaobanResponse staffStoreList(String staffId,String wxEnterpriseId){
if(StringUtils.isAnyBlank(staffId,wxEnterpriseId)){
return resultResponse(HaoBanErrCode.ERR_2);
}
List<EnterpriseDetailDTO> enterpriseList = wxEnterpriseRelatedApiService.listEnterpriseByWxEnterpriseId(wxEnterpriseId);
List<String> enterpriseIdList = enterpriseList.stream().map(EnterpriseDetailDTO::getEnterpriseId).collect(Collectors.toList());
List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCodeByStaffId(enterpriseIdList, staffId);
for (StaffClerkRelationDTO staffClerkRelationDTO : bindRelationList) {
ClerkDTO clerk = clerkService.getClerkByClerkCode(staffClerkRelationDTO.getEnterpriseId(), staffClerkRelationDTO.getClerkCode());
if(clerk != null){
StoreDTO store = storeService.getStore(clerk.getStoreId());
}
}
return resultResponse(HaoBanErrCode.ERR_10009);
}
}
package com.gic.haoban.manage.web.vo;
import java.io.Serializable;
import java.util.Date;
public class AuditVO implements Serializable{
private String commitReason;
private String auditReason;
private Integer applyStatus;
private Date commitTime;
private String auditId;
private Integer auditType;
private String clerkId;
private String clerkCode;
private String headPic;
private String commitStoreId;
private String clerkName;
private String staffName;
private String commitName;
private String commitStaffId;
public String getCommitReason() {
return commitReason;
}
public void setCommitReason(String commitReason) {
this.commitReason = commitReason;
}
public String getAuditReason() {
return auditReason;
}
public void setAuditReason(String auditReason) {
this.auditReason = auditReason;
}
public Integer getApplyStatus() {
return applyStatus;
}
public void setApplyStatus(Integer applyStatus) {
this.applyStatus = applyStatus;
}
public Date getCommitTime() {
return commitTime;
}
public void setCommitTime(Date commitTime) {
this.commitTime = commitTime;
}
public String getAuditId() {
return auditId;
}
public void setAuditId(String auditId) {
this.auditId = auditId;
}
public Integer getAuditType() {
return auditType;
}
public void setAuditType(Integer auditType) {
this.auditType = auditType;
}
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public String getClerkCode() {
return clerkCode;
}
public void setClerkCode(String clerkCode) {
this.clerkCode = clerkCode;
}
public String getHeadPic() {
return headPic;
}
public void setHeadPic(String headPic) {
this.headPic = headPic;
}
public String getCommitStoreId() {
return commitStoreId;
}
public void setCommitStoreId(String commitStoreId) {
this.commitStoreId = commitStoreId;
}
public String getClerkName() {
return clerkName;
}
public void setClerkName(String clerkName) {
this.clerkName = clerkName;
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName;
}
public String getCommitName() {
return commitName;
}
public void setCommitName(String commitName) {
this.commitName = commitName;
}
public String getCommitStaffId() {
return commitStaffId;
}
public void setCommitStaffId(String commitStaffId) {
this.commitStaffId = commitStaffId;
}
}
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