Commit 28859562 by 陶光胜

Merge branch 'developer' into 'master'

Developer

See merge request !23
parents 31f1e4be 970bad1a
......@@ -6,7 +6,7 @@ public enum FeeTypeEnum {
// ACCOUNT_BALANCE(7, "服务市场和供销平台购买明细"),
SMS_PACKAGE(4, "短信套餐包明细(余额支付)"),
SMS(3, "国内短信消费明细"),
INTERNATIONAL_SMS(8, "海外短信消费明细"),
INTERNATIONAL_SMS(8, "国际短信消费明细"),
// VOICE_CODE(2, "语音验证码消费明细"),
// DOUBLE_CALLING(6, "双向呼叫消费明细"),
// RECORDING_STORAGE(5, "录音存储消费明细"),
......
package com.gic.enterprise.dto.data;
import java.io.Serializable;
import java.util.Date;
/**
* 实付配置
* @ClassName: DataActuallyPaidConfigDTO

* @Description: 

* @author guojuxing

* @date 2020/4/17 10:27 AM

*/
public class DataActuallyPaidConfig implements Serializable{
private static final long serialVersionUID = -5443298335953111361L;
/**
*
*/
private Integer enterpriseId;
/**
* 会员业务
*/
private Integer memberBusiness;
/**
* 业绩统计
*/
private Integer performanceCount;
public Integer getEnterpriseId() {
return enterpriseId;
}
public DataActuallyPaidConfig setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public Integer getMemberBusiness() {
return memberBusiness;
}
public DataActuallyPaidConfig setMemberBusiness(Integer memberBusiness) {
this.memberBusiness = memberBusiness;
return this;
}
public Integer getPerformanceCount() {
return performanceCount;
}
public DataActuallyPaidConfig setPerformanceCount(Integer performanceCount) {
this.performanceCount = performanceCount;
return this;
}
}
......@@ -37,7 +37,7 @@ public interface DataConfigApiService {
ServiceResponse<Void> initMemberConsumeConfig(Integer enterpriseId);
/**
* 新增
* 新增实付配置
* @Title: configActuallyPaid

* @Description:

* @author guojuxing
......@@ -47,6 +47,18 @@ public interface DataConfigApiService {
ServiceResponse<Void> configActuallyPaid(List<DataActuallyPaidConfigDTO> dtoList);
/**
* 新增实付配置
* @Title: configActuallyPaid

* @Description:

* @author guojuxing
* @param enterpriseId
* @param memberBusiness 会员业务 1:开启
* @param performanceCount
业绩统计 1:开启
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>


*/
ServiceResponse<Void> configActuallyPaid(Integer enterpriseId, Integer memberBusiness, Integer performanceCount);
/**
* 实付配置信息
* @Title: listActuallyPaidConfig

* @Description:
......@@ -57,6 +69,16 @@ public interface DataConfigApiService {
ServiceResponse<List<DataActuallyPaidConfigDTO>> listActuallyPaidConfig(Integer enterpriseId);
/**
* 获取实付配置信息
* @Title: getDataActuallyPaidConfig

* @Description:

* @author guojuxing
* @param enterpriseId

* @return com.gic.api.base.commons.ServiceResponse<com.gic.enterprise.dto.data.DataActuallyPaidConfig>


*/
ServiceResponse<DataActuallyPaidConfig> getDataActuallyPaidConfig(Integer enterpriseId);
/**
* 新增商户的时候设置实付配置默认数据
* @Title: initActuallyPaidData

* @Description:
......
......@@ -53,6 +53,8 @@ public interface WmStoreApiService {
ServiceResponse<List<WmStoreDTO>> listWmStore(Integer enterpriseId);
ServiceResponse<List<WmStoreDTO>> listWmStore(Integer enterpriseId, String search);
ServiceResponse<WmStoreDTO> getWmStoreByWmMallStoreId(Integer wmMallStoreId);
/**
......
......@@ -67,7 +67,7 @@ public interface TabWmStoreMapper {
int countByStoreName(@Param("storeName") String storeName, @Param("wmMallStoreId") Integer wmMallStoreId, @Param("enterpriseId") Integer enterpriseId);
List<TabWmStore> listWmStore(@Param("enterpriseId") Integer enterpriseId, @Param("appId") String appId, @Param("authStatus") Integer authStatus);
List<TabWmStore> listWmStore(@Param("enterpriseId") Integer enterpriseId, @Param("appId") String appId, @Param("authStatus") Integer authStatus, @Param("search") String search);
TabWmStore getByWmMainAccount(String wmMainAccount);
}
\ No newline at end of file
......@@ -60,7 +60,7 @@ public interface WmStoreService {

*/
TabWmStore getByWmMainAccount(String wmMainAccount);
List<TabWmStore> listWmStore(Integer enterpriseId);
List<TabWmStore> listWmStore(Integer enterpriseId, String search);
/**
* 已授权店铺
......
......@@ -64,12 +64,12 @@ public class WmStoreServiceImpl implements WmStoreService{
}
@Override
public List<TabWmStore> listWmStore(Integer enterpriseId) {
return tabWmStoreMapper.listWmStore(enterpriseId, null, null);
public List<TabWmStore> listWmStore(Integer enterpriseId, String search) {
return tabWmStoreMapper.listWmStore(enterpriseId, null, null, search);
}
@Override
public List<TabWmStore> getHasAuth(Integer enterpriseId) {
return tabWmStoreMapper.listWmStore(enterpriseId, null, 1);
return tabWmStoreMapper.listWmStore(enterpriseId, null, 1, null);
}
}
package com.gic.enterprise.service.outer.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
......@@ -82,6 +84,38 @@ public class DataConfigApiServiceImpl implements DataConfigApiService {
}
@Override
public ServiceResponse<Void> configActuallyPaid(Integer enterpriseId, Integer memberBusiness, Integer performanceCount) {
if (memberBusiness == null) {
memberBusiness = 0;
}
if (performanceCount == null) {
performanceCount = 0;
}
List<DataActuallyPaidConfigDTO> list = new ArrayList<>(5);
list.add(new DataActuallyPaidConfigDTO()
.setEnterpriseId(enterpriseId)
.setClassify(1)
.setConfigStatus(memberBusiness));
list.add(new DataActuallyPaidConfigDTO()
.setEnterpriseId(enterpriseId)
.setClassify(2)
.setConfigStatus(memberBusiness));
list.add(new DataActuallyPaidConfigDTO()
.setEnterpriseId(enterpriseId)
.setClassify(3)
.setConfigStatus(performanceCount));
list.add(new DataActuallyPaidConfigDTO()
.setEnterpriseId(enterpriseId)
.setClassify(4)
.setConfigStatus(performanceCount));
list.add(new DataActuallyPaidConfigDTO()
.setEnterpriseId(enterpriseId)
.setClassify(5)
.setConfigStatus(performanceCount));
return configActuallyPaid(list);
}
@Override
public ServiceResponse<List<DataActuallyPaidConfigDTO>> listActuallyPaidConfig(Integer enterpriseId) {
List<TabDataActuallyPaidConfig> list = dataActuallyPaidConfigService.listByEnterpriseId(enterpriseId);
if (CollectionUtils.isEmpty(list)) {
......@@ -93,6 +127,22 @@ public class DataConfigApiServiceImpl implements DataConfigApiService {
}
@Override
public ServiceResponse<DataActuallyPaidConfig> getDataActuallyPaidConfig(Integer enterpriseId) {
List<TabDataActuallyPaidConfig> list = dataActuallyPaidConfigService.listByEnterpriseId(enterpriseId);
if (CollectionUtils.isNotEmpty(list)) {
Map<String, Integer> map = list.stream().collect(Collectors.toMap(e -> e.getClassify().toString(), e -> e.getConfigStatus()));
//如果没有配置,默认数据
Integer memberBusiness = map.get("1");
Integer performanceCount = map.get("3");
return ServiceResponse.success(new DataActuallyPaidConfig()
.setEnterpriseId(enterpriseId)
.setMemberBusiness(memberBusiness)
.setPerformanceCount(performanceCount));
}
return ServiceResponse.success(new DataActuallyPaidConfig().setEnterpriseId(enterpriseId).setMemberBusiness(0).setPerformanceCount(0));
}
@Override
public ServiceResponse<Void> initActuallyPaidData(Integer enterpriseId) {
List<TabDataActuallyPaidConfig> list = dataActuallyPaidConfigService.listByEnterpriseId(-1);
list = list.stream().map(e -> e.setEnterpriseId(enterpriseId)).map(e -> e.setActuallyPaidConfigId(null))
......
......@@ -77,7 +77,13 @@ public class WmStoreApiServiceImpl implements WmStoreApiService {
@Override
public ServiceResponse<List<WmStoreDTO>> listWmStore(Integer enterpriseId) {
List<TabWmStore> list = wmStoreService.listWmStore(enterpriseId);
List<TabWmStore> list = wmStoreService.listWmStore(enterpriseId, null);
return ServiceResponse.success(EntityUtil.changeEntityListNew(WmStoreDTO.class, list));
}
@Override
public ServiceResponse<List<WmStoreDTO>> listWmStore(Integer enterpriseId, String search) {
List<TabWmStore> list = wmStoreService.listWmStore(enterpriseId, search);
return ServiceResponse.success(EntityUtil.changeEntityListNew(WmStoreDTO.class, list));
}
......
......@@ -242,6 +242,9 @@
<if test="authStatus != null">
and auth_status = #{authStatus}
</if>
<if test="search != null and search !=''">
and wm_main_account like concat('%', #{search}, '%')
</if>
</select>
<select id="getByWmMainAccount" resultMap="BaseResultMap">
......
......@@ -56,6 +56,14 @@ public class DataConfigController {
UserDetailUtils.getUserDetail().getEnterpriseInfo().getEnterpriseName());
}
@RequestMapping("/config-actually-paid-new")
public RestResponse configActuallyPaidNew(Integer memberBusiness, Integer performanceCount) {
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
return OperationResultUtils.operationResult(dataConfigApiService.configActuallyPaid(enterpriseId, memberBusiness, performanceCount),
OperationResultUtils.LOG_EDIT + "数据统计配置-实付配置",
UserDetailUtils.getUserDetail().getEnterpriseInfo().getEnterpriseName());
}
@RequestMapping("/get-actually-paid-config")
public RestResponse getActuallyPaidConfig() {
return ResultControllerUtils.commonResult(
......@@ -63,6 +71,13 @@ public class DataConfigController {
ActuallyPaidConfigVO.class);
}
@RequestMapping("/get-actually-paid-config-new")
public RestResponse getActuallyPaidConfigNew() {
return ResultControllerUtils.commonResult(
dataConfigApiService.getDataActuallyPaidConfig(UserDetailUtils.getUserDetail().getEnterpriseId()),
ActuallyPaidConfigVO.class);
}
@RequestMapping("/config-single-effect")
public RestResponse configSingleEffect(String jsonArr) {
if (StringUtil.isBlank(jsonArr)) {
......
......@@ -233,15 +233,15 @@ public class QrcodeController {
}
@RequestMapping("take-applet-qrcode")
public RestResponse takeAppletQrcode(String appkey, Integer pathId){
public RestResponse takeAppletQrcode(String appkey, Integer pageId){
String path = "pages/customView/customView";
byte[] appletQrcode = this.createAppletQrcode(appkey, path);
byte[] appletQrcode = this.createAppletQrcode(appkey, path, pageId+"");
UploadResult uploadResult = QQCloudPicUtils.uploadLocalPicStream("pic01", "", appletQrcode);
Map<String, Object> pic = new HashMap<>();
pic.put("fileId", uploadResult.getFileId());
pic.put("url", uploadResult.getUrl());
pic.put("downloadUrl", uploadResult.getDownloadUrl());
pic.put("path", path+"?pageId="+pathId);
pic.put("path", path+"?pageId="+pageId);
return RestResponse.success(pic);
}
......@@ -249,7 +249,7 @@ public class QrcodeController {
@IgnoreLogin
public RestResponse takeStoreQrcode(String appkey, Integer id, Integer qrcodeType){
String path = "pages/index/index?qrcodeParam="+id+"&qrcodeType="+qrcodeType;
byte[] appletQrcode = this.createAppletQrcode(appkey, path);
byte[] appletQrcode = this.createAppletQrcode(appkey, path, id+"");
UploadResult uploadResult = QQCloudPicUtils.uploadLocalPicStream("pic01", "", appletQrcode);
Map<String, Object> pic = new HashMap<>();
pic.put("fileId", uploadResult.getFileId());
......@@ -313,7 +313,7 @@ public class QrcodeController {
appletPath += "?qrcodeParam="+qrcodeId;
String[] appletArr = dto.getAppletIds().split(",");
for (String s : appletArr) {
byte[] appletQrcode = createAppletQrcode(s, appletPath);
byte[] appletQrcode = createAppletQrcode(s, appletPath, "");
if(appletQrcode != null){
ZipEntry e = new ZipEntry(content.getTitle() + File.separator + s + File.separator + content.getTitle() + ".jpg");
zipOutputStream.putNextEntry(e);
......@@ -356,8 +356,8 @@ public class QrcodeController {
return null;
}
private byte[] createAppletQrcode(String appkey, String path){
ServiceResponse<Map<String, Object>> wxaQrcode = this.weixinWxaFunService.createWxaQrcode(appkey, path, 1280);
private byte[] createAppletQrcode(String appkey, String path, String scene){
ServiceResponse<Map<String, Object>> wxaQrcode = this.weixinWxaFunService.getWxaCodeUnlimit(appkey, path, scene);
if(wxaQrcode.isSuccess()){
Map<String, Object> result = wxaQrcode.getResult();
return (byte[]) result.get("content");
......
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