Commit 86e568d1 by 陶光胜

门店导出修改

parent 9d6aa597
......@@ -26,6 +26,22 @@ public interface ClerkApiService {
*/
ServiceResponse<Void> saveOrUpdate(ClerkDTO clerkDTO);
/** @Description: 订单途经保存导购
* @author taogs
* @Date 19:52 2020/1/8
* @Param
* @return
*/
ServiceResponse<Integer> saveClerkForOrder(String clerkName, String clerkCode, Integer storeId, Integer enterpriseId, String orderNum);
/** @Description: 通过导购code查询导购
* @author taogs
* @Date 19:52 2020/1/8
* @Param
* @return
*/
ServiceResponse<ClerkDTO> getClerkByCode(Integer enterpriseId, String clerkCode, Integer storeId);
/**
* @Title: listClerk
* @Description: 导购列表
......
......@@ -68,6 +68,16 @@ public class ClerkApiServiceImpl implements ClerkApiService {
return ServiceResponse.success();
}
@Override
public ServiceResponse<Integer> saveClerkForOrder(String clerkName, String clerkCode, Integer storeId, Integer enterpriseId, String orderNum) {
return null;
}
@Override
public ServiceResponse<ClerkDTO> getClerkByCode(Integer enterpriseId, String clerkCode, Integer storeId) {
return null;
}
private void storeLogByAddClerk(ClerkDTO clerkDTO) {
StoreLogDTO storeLogDTO = new StoreLogDTO();
storeLogDTO.setEnterpriseId(clerkDTO.getEnterpriseId());
......
......@@ -138,6 +138,11 @@
<artifactId>gic-log-api</artifactId>
<version>${gic-log-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-wechat-business-api</artifactId>
<version>${gic-wechat-business-api}</version>
</dependency>
</dependencies>
<build>
......
......@@ -6,14 +6,14 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
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.qo.QrcodeContent;
import com.gic.download.utils.*;
import com.gic.download.utils.log.LogUtils;
import com.gic.enterprise.context.RequestContext;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.response.EnterpriseRestResponse;
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.log.api.service.LogApiService;
......@@ -23,11 +23,14 @@ import com.gic.store.dto.*;
import com.gic.store.service.*;
import com.gic.store.utils.StoreRedisKeyUtils;
import com.gic.store.web.qo.PageQO;
import com.gic.store.web.qo.store.QrcodeQO;
import com.gic.store.web.qo.store.StoreExportQO;
import com.gic.store.web.qo.store.StoreQO;
import com.gic.store.web.vo.StoreExportFieldVO;
import com.gic.store.web.vo.StoreListSourceVO;
import com.gic.store.web.vo.StoreOverflowVO;
import com.gic.wechat.business.api.service.fwh.WeixinBaseFunService;
import com.gic.wechat.business.api.service.wxa.WeixinWxaFunService;
import org.apache.catalina.User;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -69,6 +72,14 @@ public class StoreController extends DownloadUtils {
private StoreFieldApiService storeFieldApiService;
@Autowired
private StoreFieldSelectApiService storeFieldSelectApiService;
@Autowired
private QrCodeApiService qrCodeApiService;
@Autowired
private WeixinBaseFunService weixinBaseFunService;
@Autowired
private WeixinWxaFunService weixinWxaFunService;
@Autowired
private DownloadReportApiService downloadReportApiService;
private Map<Integer, SimpleDateFormat> map = new ConcurrentHashMap<>();
private Map<Integer, SimpleDateFormat> map1 = new ConcurrentHashMap<>();
......@@ -313,6 +324,48 @@ public class StoreController extends DownloadUtils {
}
}
@RequestMapping("store-qrcode-download")
public RestResponse storeQrcodeDownload(@RequestBody QrcodeQO qrcodeQO){
int total = qrcodeQO.getContent().size();
if(qrcodeQO.getIsAll() == 1){
StoreSearchDTO storeSearchDTO = EntityUtil.changeEntityByJSON(StoreSearchDTO.class, qrcodeQO);
storeSearchDTO.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
ServiceResponse<Long> serviceResponse = this.storeApiService.queryStoreCountFromES(storeSearchDTO);
total = serviceResponse.getResult().intValue();
if(total == 0){
return RestResponse.failure(ErrorCode.NOTEXISTS.getCode(), "没有门店下载二维码");
}
}
new QrcodeDownload(){
@Override
public List<QrcodeContent> getContent(int pageNum, int pageSize){
if(qrcodeQO.getIsAll() == 1){
StoreSearchDTO storeSearchDTO = EntityUtil.changeEntityByJSON(StoreSearchDTO.class, qrcodeQO);
storeSearchDTO.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
ServiceResponse<Page<StoreDTO>> response = storeApiService.listStore(storeSearchDTO, pageNum, pageNum);
if(response.isSuccess() && response.getResult() != null){
Page<StoreDTO> result = response.getResult();
if(CollectionUtils.isNotEmpty(result.getResult())){
List<QrcodeContent> list = new ArrayList<>();
for(StoreDTO dto : result.getResult()){
QrcodeContent qrcodeContent = new QrcodeContent();
qrcodeContent.setCustomParams(dto.getStoreId()+"");
qrcodeContent.setTitle(dto.getStoreName());
list.add(qrcodeContent);
}
return list;
}
}
}else {
return EntityUtil.changeEntityListByJSON(QrcodeContent.class, qrcodeQO.getContent());
}
return null;
}
}.takeQrcode(EntityUtil.changeEntityByJSON(com.gic.download.qo.QrcodeQO.class, qrcodeQO), total,
downloadReportApiService, weixinBaseFunService, weixinWxaFunService, qrCodeApiService);
return RestResponse.success();
}
private List<StoreListSourceVO> getStoreAllListSource(Integer enterpriseId) {
List<StoreListSourceVO> list = new ArrayList<>();
ServiceResponse<List<StoreDictDTO>> serviceResponse = this.storeDictApiService.listStoreField(enterpriseId);
......
package com.gic.store.web.qo.store;
import java.io.Serializable;
public class QrcodeContent implements Serializable {
private String customParams;
private String content;
private String title;
public String getCustomParams() {
return customParams;
}
public void setCustomParams(String customParams) {
this.customParams = customParams;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
package com.gic.store.web.qo.store;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.gic.store.dto.StoreSearchDTO;
import org.apache.commons.lang.StringUtils;
public class QrcodeQO extends StoreSearchDTO 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;
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;
}
}
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