Commit 079608f8 by qwmqiuwenmin

Merge branch 'developer' of http://115.159.76.241/haoban3.0/haoban-manage3.0.git into developer

parents 5d126b0c 038120cd
......@@ -18,6 +18,8 @@ public class AuditDTO implements Serializable {
private String commitStoreId;
private String commitStoreName;
private String changeField;
private String oldValue;
......@@ -44,7 +46,15 @@ public class AuditDTO implements Serializable {
private static final long serialVersionUID = 1L;
public String getDetail() {
public String getCommitStoreName() {
return commitStoreName;
}
public void setCommitStoreName(String commitStoreName) {
this.commitStoreName = commitStoreName;
}
public String getDetail() {
return detail;
}
......
package com.gic.haoban.manage.web.controller;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ctrip.framework.apollo.spring.annotation.ApolloConfig;
import com.gic.api.base.commons.Page;
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.GlobalVar;
import com.gic.haoban.manage.api.dto.*;
......@@ -14,12 +20,14 @@ import com.gic.haoban.manage.api.service.ApplicationSettingApiService;
import com.gic.haoban.manage.api.service.AuditApiService;
import com.gic.haoban.manage.api.service.AuditSettingApiService;
import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.WxApplicationApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.web.anno.IgnoreLogin;
import com.gic.haoban.manage.web.auth.AuthRequestUtil;
import com.gic.haoban.manage.web.config.Config;
import com.gic.haoban.manage.web.vo.LoginVO;
import com.gic.haoban.manage.web.vo.StaffVO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
......@@ -44,6 +52,11 @@ public class AuditController extends WebBaseController{
private AuditSettingApiService auditSettingApiService;
@Autowired
private AuditApiService auditApiService;
@Autowired
private StaffApiService staffApiService;
@Autowired
private StoreService storeService;
//设置保存
@RequestMapping("open-or-close")
public HaobanResponse openOrClose(String wxEnterpriseId,Integer auditFlag) {
......@@ -80,17 +93,21 @@ public class AuditController extends WebBaseController{
}
Page<AuditDTO> page = auditApiService.page(auditType, search, wxEnterpriseId,enterpriseId, auditStatus, pageInfo);
List<AuditDTO> list = page.getResult();
List<String> storeIds = list.stream().map(s->s.getCommitStoreId()).collect(Collectors.toList());
String[] array=storeIds.toArray(new String[storeIds.size()]);
List<StoreDTO> stores = storeService.getStores(array);
Map<String,StoreDTO> map = com.gic.commons.util.CollectionUtil.toMap(stores, "storeId");
for(AuditDTO dto:list){
String t = dto.getChangeField();
String detail = "";
if(StoreFieldEnum.STORE_NAME.getValue().equals(t)){
detail = "将"+"门店名称"+dto.getOldValue()+"修改为"+dto.getNewValue();
detail = "将"+"门店名称"+"\""+dto.getOldValue()+"\""+"修改为"+"\""+dto.getNewValue()+"\"";
}else if(StoreFieldEnum.STORE_AREA.getValue().equals(t)){
detail = "将"+"门店面积"+dto.getOldValue()+"修改为"+dto.getNewValue();
detail = "将"+"门店面积"+"\""+dto.getOldValue()+"\""+"修改为"+"\""+dto.getNewValue()+"\"";
}else if(StoreFieldEnum.CONACTS_PHONE.getValue().equals(t)){
detail = "将"+"联系电话"+dto.getOldValue()+"修改为"+dto.getNewValue();
detail = "将"+"联系电话"+"\""+dto.getOldValue()+"\""+"修改为"+"\""+dto.getNewValue()+"\"";
}else if(StoreFieldEnum.BUSINESS_TIME_STRING.getValue().equals(t)){
detail = "将"+"营业时间"+dto.getOldValue()+"修改为"+dto.getNewValue();
detail = "将"+"营业时间"+"\""+dto.getOldValue()+"\""+"修改为"+"\""+dto.getNewValue()+"\"";
}else if(StoreFieldEnum.STORE_ADDRESS.getValue().equals(t)){
String oldValue = dto.getOldValue();
String newValue = dto.getNewValue();
......@@ -99,15 +116,34 @@ public class AuditController extends WebBaseController{
JSONObject newJSONObject = JSONObject.parseObject(newValue);
String newAddress = newJSONObject.get("storeAddress").toString();
detail = "将"+"门店地址"+oldAddress+"修改为"+newAddress;
detail = "将"+"门店地址"+"\""+oldAddress+"\""+"修改为"+"\""+newAddress+"\"";
}else if(StoreFieldEnum.STORE_IMAG.getValue().equals(t)){
detail = "门店图片变更";
}
dto.setDetail(detail);
String storeName = map.get(dto.getCommitStoreId())==null?"":map.get(dto.getCommitStoreId()).getStoreName();
dto.setCommitStoreName(storeName);
}
page.setResult(list);
return resultResponse(HaoBanErrCode.ERR_1,page);
}
//获取详情
@RequestMapping("get-staff-detail")
public HaobanResponse getStaffDetail(String staffId ) {
if(StringUtils.isAnyBlank(staffId)){
return resultResponse(HaoBanErrCode.ERR_2);
}
StaffDTO staffDTO = staffApiService.selectById(staffId);
// StaffVO staffVO = new StaffVO();
// staffVO.setPhoneNumber(phoneNumber);
// staffVO.setNationCode(nationCode);
// staffVO.setPostion(postion);
return resultResponse(HaoBanErrCode.ERR_1,staffDTO);
}
//审核拒绝
@RequestMapping("refuse")
public HaobanResponse refuse(String auditId,String auditReason ) {
......
package com.gic.haoban.manage.web.vo;
import java.io.Serializable;
import com.gic.haoban.manage.api.dto.StaffDTO;
public class StaffVO implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private String staffName;
private String phoneNumber;
private String nationCode;
private String postion;
private String departmentName;
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public String getNationCode() {
return nationCode;
}
public void setNationCode(String nationCode) {
this.nationCode = nationCode;
}
public String getPostion() {
return postion;
}
public void setPostion(String postion) {
this.postion = postion;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
}
package com.gic.haoban.manage.web.controller;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import cn.hutool.core.collection.CollectionUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.ApplicationDTO;
import com.gic.haoban.manage.api.dto.ApplicationSettingDTO;
import com.gic.haoban.manage.api.service.ApplicationApiService;
import com.gic.haoban.manage.api.service.ApplicationSettingApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
@RestController
......@@ -18,18 +24,33 @@ public class ApplicationController extends WebBaseController{
@Autowired
private ApplicationApiService applicationApiService;
@Autowired
private ApplicationSettingApiService applicationSettingApiService;
@RequestMapping("application-list")
public HaobanResponse applicationList() {
public HaobanResponse applicationList(String wxEnterpriseId) {
List<ApplicationDTO> list = applicationApiService.listApplication();
List<String> applicationIds = list.stream().map(s->s.getApplicationId()).collect(Collectors.toList());
List<ApplicationSettingDTO> settings = applicationSettingApiService.listOpenByWxEnterpriseIdAndApplicationIds(wxEnterpriseId, applicationIds);
List<String> openApplicationIds = new ArrayList<String>();
if(CollectionUtil.isNotEmpty(settings)){
openApplicationIds = settings.stream().map(s->s.getApplicationId()).collect(Collectors.toList());
}
Iterator<ApplicationDTO> it = list.listIterator();
while(it.hasNext()){
ApplicationDTO app = it.next();
if(!openApplicationIds.contains(app.getApplicationId())){
it.remove();
continue ;
}
if("通讯录".equals(app.getApplicationName())){
it.remove();
continue ;
}
}
return resultResponse(HaoBanErrCode.ERR_1,list);
}
......
......@@ -32,6 +32,7 @@
<dubbo:reference interface="com.gic.haoban.manage.api.service.AuditApiService" id="auditApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.AuditSettingApiService" id="auditSettingApiService"/>
<dubbo:reference interface="com.gic.dict.api.service.ManagerDictService" id="managerDictService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.ApplicationSettingApiService" id="applicationSettingApiService"/>
<dubbo:reference interface="com.gic.haoban.communicate.api.service.valid.ValidationCodeService" id="validationCodeService"/>
......
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