Commit c3e20e2b by 陶光胜

门店导出修改

parent 503e1364
......@@ -6,25 +6,26 @@ import com.gic.auth.dto.MenuDTO;
import com.gic.auth.service.MenuApiService;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.download.utils.DataDownloadUtils;
import com.gic.download.utils.DownloadReport;
import com.gic.download.utils.DownloadUtils;
import com.gic.download.utils.ExecutorPoolSingleton;
import com.gic.download.constants.QrcodeTypeEnum;
import com.gic.download.qo.QrcodeContent;
import com.gic.download.utils.*;
import com.gic.download.utils.log.LogUtils;
import com.gic.enterprise.constants.Constants;
import com.gic.enterprise.context.RequestContext;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.service.DownloadReportApiService;
import com.gic.enterprise.service.QrCodeApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.store.constant.ClerkLogReasonEnum;
import com.gic.store.dto.ClerkDTO;
import com.gic.store.dto.ClerkLogDTO;
import com.gic.store.dto.ClerkSearchDTO;
import com.gic.store.dto.ClerkStoreListDTO;
import com.gic.store.dto.*;
import com.gic.store.service.ClerkApiService;
import com.gic.store.service.ClerkLogApiService;
import com.gic.store.web.qo.PageQO;
import com.gic.store.web.qo.clerk.ClerkQO;
import com.gic.store.web.qo.store.ClerkQrcodeQO;
import com.gic.wechat.business.api.service.fwh.WeixinBaseFunService;
import com.gic.wechat.business.api.service.wxa.WeixinWxaFunService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
......@@ -53,6 +54,14 @@ public class ClerkController extends DownloadUtils {
private ClerkLogApiService clerkLogApiService;
@Autowired
private MenuApiService menuApiService;
@Autowired
private QrCodeApiService qrCodeApiService;
@Autowired
private WeixinBaseFunService weixinBaseFunService;
@Autowired
private WeixinWxaFunService weixinWxaFunService;
@Autowired
private DownloadReportApiService downloadReportApiService;
@RequestMapping("/list-clerk-field")
public RestResponse listClerkField() {
......@@ -140,6 +149,46 @@ public class ClerkController extends DownloadUtils {
return RestResponse.success(reportId);
}
@RequestMapping("clerk-qrcode-download")
public RestResponse clerkQrcodeDownload(@RequestBody ClerkQrcodeQO clerkQrcodeQO){
int total = clerkQrcodeQO.getContent().size();
if(clerkQrcodeQO.getIsAll() == 1){
ClerkSearchDTO clerkSearchDTO = clerkQrcodeQO.getClerkSearchDTO();
clerkSearchDTO.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
ServiceResponse<Integer> totalClerkServiceResponse = clerkApiService.getTotalClerk(UserDetailUtils.getUserDetail().getEnterpriseId(), clerkSearchDTO);
total = totalClerkServiceResponse.getResult();
if (totalClerkServiceResponse.getResult() == 0) {
return RestResponse.failure(ErrorCode.NOTEXISTS.getCode(), ErrorCode.NOTEXISTS.getMsg());
}
}
new QrcodeDownload(){
@Override
public List<QrcodeContent> getContent(int pageNum, int pageSize){
if(clerkQrcodeQO.getIsAll() == 1){
ClerkSearchDTO clerkSearchDTO = clerkQrcodeQO.getClerkSearchDTO();
clerkSearchDTO.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
ServiceResponse<Page<ClerkStoreListDTO>> result = clerkApiService.listClerk(clerkSearchDTO.getEnterpriseId(), clerkSearchDTO, pageNum, 500);
List<ClerkStoreListDTO> clerkStoreList = result.getResult().getResult();
List<QrcodeContent> clerkDTOS = new ArrayList<>();
for (ClerkStoreListDTO clerkStoreListDTO : clerkStoreList) {
List<ClerkDTO> clerkList = clerkStoreListDTO.getClerkList();
for (ClerkDTO clerkDTO : clerkList) {
QrcodeContent qrcodeContent = new QrcodeContent();
qrcodeContent.setTitle(clerkDTO.getClerkName());
qrcodeContent.setCustomParams(clerkDTO.getClerkId()+"");
clerkDTOS.add(qrcodeContent);
}
}
return clerkDTOS;
}else {
return EntityUtil.changeEntityListByJSON(QrcodeContent.class, clerkQrcodeQO.getContent());
}
}
}.takeQrcode(EntityUtil.changeEntityByJSON(com.gic.download.qo.QrcodeQO.class, clerkQrcodeQO), total, QrcodeTypeEnum.CLERK.getType(),
downloadReportApiService, weixinBaseFunService, weixinWxaFunService, qrCodeApiService);
return RestResponse.success();
}
private String getDataContent() {
String dataContent;
Integer moduleMenuId = (Integer) RequestContext.getContext().getRequest().getAttribute("moduleMenuId");
......
package com.gic.store.web.qo.store;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.gic.store.dto.ClerkSearchDTO;
import org.apache.commons.lang.StringUtils;
import com.gic.store.dto.StoreSearchDTO;
public class ClerkQrcodeQO implements Serializable {
private Integer h5 = 0;
private String appletIds;
private String fwhIds;
private String scenesValueIds;
private Integer type; //1临时二维码 2永久二维码
private Date endTime;
private Integer isAll = 0;
private List<QrcodeContent> content;
private String callBackService;
private String callBackMethod;
private String fileName;
private ClerkSearchDTO clerkSearchDTO;
public Integer getH5() {
return h5;
}
public void setH5(Integer h5) {
if(h5 != null && StringUtils.isNotBlank(h5+"")){
this.h5 = h5;
}
}
public String getAppletIds() {
return appletIds;
}
public void setAppletIds(String appletIds) {
this.appletIds = appletIds;
}
public String getFwhIds() {
return fwhIds;
}
public void setFwhIds(String fwhIds) {
this.fwhIds = fwhIds;
}
public String getScenesValueIds() {
return scenesValueIds;
}
public void setScenesValueIds(String scenesValueIds) {
this.scenesValueIds = scenesValueIds;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public List<QrcodeContent> getContent() {
return content;
}
public void setContent(List<QrcodeContent> content) {
this.content = content;
}
public String getCallBackService() {
return callBackService;
}
public void setCallBackService(String callBackService) {
this.callBackService = callBackService;
}
public String getCallBackMethod() {
return callBackMethod;
}
public void setCallBackMethod(String callBackMethod) {
this.callBackMethod = callBackMethod;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public Integer getIsAll() {
return isAll;
}
public void setIsAll(Integer isAll) {
this.isAll = isAll;
}
public ClerkSearchDTO getClerkSearchDTO() {
return clerkSearchDTO;
}
public void setClerkSearchDTO(ClerkSearchDTO clerkSearchDTO) {
this.clerkSearchDTO = clerkSearchDTO;
}
}
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