Commit c31c9a06 by 陶光胜

代码规范

parent 29e75637
......@@ -59,7 +59,7 @@ public interface TabAppletCustomPageMapper {
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeyWithBLOBs(TabAppletCustomPage record);
int updateByPrimaryKeyWithBlobs(TabAppletCustomPage record);
/**
* 根据主键更新记录
......
......@@ -58,7 +58,7 @@ public interface TabAppletPageComponentMapper {
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeyWithBLOBs(TabAppletPageComponent record);
int updateByPrimaryKeyWithBlobs(TabAppletPageComponent record);
/**
* 根据主键更新记录
......
package com.gic.enterprise.entity;
import com.gic.commons.annotation.SkipNamingCheck;
import java.util.Date;
/**
......@@ -9,6 +11,7 @@ import java.util.Date;
* @author taogs
* @date 2020/9/11 15:46
*/
@SkipNamingCheck
public class TabQrcodeDownload {
/**
*
......
......@@ -64,29 +64,6 @@ public class LinkServiceImpl implements LinkService {
return tabLinkMapper.updateByPrimaryKeySelective(tabLink);
}
// @Override
// public Integer saveLinkMenu(Integer parentId, String name, Integer type) {
// TabLink tabLink = new TabLink();
// tabLink.setCreateTime(new Date());
// tabLink.setParentId(parentId);
// tabLink.setStatus(Constants.NORMAL_STATUS);
// tabLink.setType(type);
// tabLink.setName(name);
// tabLink.setIsCustom(Constants.NORMAL_STATUS);
// tabLink.setEnterpriseType(LinkEnterpriseTypeEnum.ALL.getCode());
// tabLinkMapper.insertSelective(tabLink);
// return tabLink.getLinkId();
// }
//
// @Override
// public int updateLinkMenu(Integer linkId, String name, Integer type) {
// TabLink tabLink = new TabLink();
// tabLink.setLinkId(linkId);
// tabLink.setName(name);
// tabLink.setType(type);
// return tabLinkMapper.updateByPrimaryKeySelective(tabLink);
// }
@Override
public void updateLinkMenu(LinkDTO linkDTO) {
TabLink tabLink = EntityUtil.changeEntityByJSON(TabLink.class, linkDTO);
......
......@@ -120,11 +120,9 @@ public class CustomGuideApiServiceImpl implements CustomGuideApiService {
} else {
themeStr = "tint-green";
}
// networkTimeout
Map<String, Object> networkTimeoutMap = new HashMap<String, Object>();
networkTimeoutMap.put("request", 20000);
networkTimeoutMap.put("downloadFile", 20000);
// tabBar
List<Map<String, Object>> tabBarList = new ArrayList<>();
Set<String> pathSet = new HashSet<String>() ;
String iconPath = "/images/footbar/"+themeStr+"/";
......@@ -152,29 +150,42 @@ public class CustomGuideApiServiceImpl implements CustomGuideApiService {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "存在相同的路径");
}
Map<String, Object> tabBar = new HashMap<String, Object>();
Map<String, Object> windowMap = new HashMap<String, Object>();
Map<String, Object> ext = new HashMap<String, Object>();
List<String> appIdList = new ArrayList<>() ;
buildMap(tabBar, windowMap, ext, tabBarList, response, appid, themeStr, maxVersion, enterpriseId, appIdList);
log.info("ext文件,enterpriseId={} , appid={}" , enterpriseId, appIdList);
ext.put("navigateToMiniProgramAppIdList", appIdList) ;
returnMap.put("extEnable", true);
returnMap.put("extAppid", appid);
returnMap.put("ext", ext);
returnMap.put("extPages", new HashMap<String, Object>());
returnMap.put("window", windowMap);
returnMap.put("tabBar", tabBar);
returnMap.put("networkTimeout", networkTimeoutMap);
returnMap.put("navigateToMiniProgramAppIdList", appIdList) ;
return ServiceResponse.success(returnMap);
}
private void buildMap(Map<String, Object> tabBar, Map<String, Object> windowMap, Map<String, Object> ext,
List<Map<String, Object>> tabBarList, ServiceResponse<EnterpriseDTO> response, String appid,
String themeStr, Integer maxVersion, Integer enterpriseId, List<String> appIdList){
tabBar.put("color", "#999999");
tabBar.put("selectedColor", "#dabb7d");
tabBar.put("backgroundColor", "#ffffff");
tabBar.put("borderStyle", "black");
tabBar.put("list", tabBarList);
// window
Map<String, Object> windowMap = new HashMap<String, Object>();
windowMap.put("enablePullDownRefresh", false);
windowMap.put("backgroundTextStyle", "light");
windowMap.put("navigationBarBackgroundColor", "#fff");
windowMap.put("navigationBarTitleText", response.getResult().getEnterpriseName());
windowMap.put("navigationBarTextStyle", "black");
Map<String, Object> ext = new HashMap<String, Object>();
ext.put("name", response.getResult().getEnterpriseName());
ext.put("appid", appid);
ext.put("brandName", response.getResult().getEnterpriseName());
ext.put("theme", themeStr);
ext.put("tabBar", tabBar);
ext.put("build", maxVersion);
//
List<String> appIdList = new ArrayList<>() ;
ServiceResponse<Page<AppletAppDTO>> page = this.appletAppApiService.page(null, enterpriseId, 1, 1, 1, 1000);
if(page.isSuccess() && page.getResult()!= null){
List<AppletAppDTO> wxaList = page.getResult().getResult();
......@@ -189,17 +200,5 @@ public class CustomGuideApiServiceImpl implements CustomGuideApiService {
}
}
}
log.info("ext文件,enterpriseId={} , appid={}" , enterpriseId, appIdList);
ext.put("navigateToMiniProgramAppIdList", appIdList) ;
// return
returnMap.put("extEnable", true);
returnMap.put("extAppid", appid);
returnMap.put("ext", ext);
returnMap.put("extPages", new HashMap<String, Object>());
returnMap.put("window", windowMap);
returnMap.put("tabBar", tabBar);
returnMap.put("networkTimeout", networkTimeoutMap);
returnMap.put("navigateToMiniProgramAppIdList", appIdList) ;
return ServiceResponse.success(returnMap);
}
}
......@@ -45,8 +45,8 @@ public class CustomStoreApiServiceImpl implements CustomStoreApiService {
public ServiceResponse<Page<CustomStoreDTO>> pageCustomStore(Integer enterpriseId, String search, String appid, Integer pageNum, Integer pageSize) {
PageHelper.startPage(pageNum, pageSize);
com.github.pagehelper.Page<TabCustomStore> page = this.customStoreService.pageCustomStore(search, enterpriseId, appid);
Page<CustomStoreDTO> storeDTOPage = PageHelperUtils.changePageHelperToCurrentPage(page, CustomStoreDTO.class);
return ServiceResponse.success(storeDTOPage);
Page<CustomStoreDTO> storePage = PageHelperUtils.changePageHelperToCurrentPage(page, CustomStoreDTO.class);
return ServiceResponse.success(storePage);
}
......
......@@ -109,7 +109,7 @@ public class DoubleCallingApiServiceImpl implements DoubleCallingApiService {
billingAccountService.deductAccountByCache(doubleCallingRecordDTO.getFee(), doubleCallingRecordDTO.getEnterpriseId());
// 队列
// client.sendMessage("doubleCallDealDbMq", arg);
this.executeDatabase2(arg);
this.executeDatabaseTwo(arg);
} catch (Exception e) {
logger.warn("调用mq失败", e);
}
......@@ -147,7 +147,7 @@ public class DoubleCallingApiServiceImpl implements DoubleCallingApiService {
return ServiceResponse.success();
}
public ServiceResponse<Void> executeDatabase2(String arg) {
public ServiceResponse<Void> executeDatabaseTwo(String arg) {
logger.info("执行双向呼叫计费:{}", arg);
DoubleCallingRecordDTO doubleCallingRecordDTO = JSON.parseObject(arg, DoubleCallingRecordDTO.class);
doubleCallingRecordDTO.setPaySerialNumber(CreateRandomUtils.createSerialNumber());
......
......@@ -571,9 +571,9 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
params.getEnterpriseId(), params.getOperName(), params.getOrderType(), params.getStatus());
if (list.isSuccess()) {
Page<OrderGicHbDTO> page1 = list.getResult();
resultPage = EntityUtil.changeEntityNew(Page.class, page1);
List<OrderGicDTO> orderGicDTOList = EntityUtil.changeEntityListNew(OrderGicDTO.class, page1.getResult());
Page<OrderGicHbDTO> orderGicHbPage = list.getResult();
resultPage = EntityUtil.changeEntityNew(Page.class, orderGicHbPage);
List<OrderGicDTO> orderGicDTOList = EntityUtil.changeEntityListNew(OrderGicDTO.class, orderGicHbPage.getResult());
resultPage.setResult(orderGicDTOList);
}
return ServiceResponse.success(resultPage);
......
......@@ -22,7 +22,7 @@ import com.gic.log.api.dto.SystemSetLogDTO;
import com.gic.log.api.service.LogApiService;
import com.gic.marketing.process.api.service.sms.SmsSendApiService;
import com.gic.thirdparty.api.dto.ScanPayReqDataDTO;
import com.gic.thirdparty.api.service.Pay4WXService;
import com.gic.thirdparty.api.service.Pay4WxService;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -43,7 +43,7 @@ public class WxPayStrategy implements PayStrategy {
private Logger logger = LogManager.getLogger(WxPayStrategy.class);
@Autowired
private Pay4WXService pay4WxService;
private Pay4WxService pay4WxService;
@Autowired
private BillingPayInfoService billingPayInfoService;
@Autowired
......@@ -134,9 +134,9 @@ public class WxPayStrategy implements PayStrategy {
case 2:
// 短信套餐包购买
this.billingOrderService.updateBySerialNumber(billingPayInfo.getOrderSerialNumber(), resData.getTotalFeePaid(), BillingAuditStatusEnum.PASS.getCode(), resData.getTimeEnd());
TabBillingRechargeRecord rechargeRecord2 = billingRechargeRecordService.getRechargeRecordBySerialNumber(billingPayInfo.getOrderSerialNumber());
UserDTO userDto2 = userApiService.getUserById(rechargeRecord2.getInitiatorUser()).getResult();
createLog("支付", "订单内容", userDto2);
TabBillingRechargeRecord tabBillingRechargeRecord = billingRechargeRecordService.getRechargeRecordBySerialNumber(billingPayInfo.getOrderSerialNumber());
UserDTO user = userApiService.getUserById(tabBillingRechargeRecord.getInitiatorUser()).getResult();
createLog("支付", "订单内容", user);
break;
default:
break;
......@@ -164,7 +164,7 @@ public class WxPayStrategy implements PayStrategy {
"",
"NATIVE"
);
ServiceResponse<String> serviceResponse = pay4WxService.createPrePaymentOrderForWX(scanPayReqDataDTO);
ServiceResponse<String> serviceResponse = pay4WxService.createPrePaymentOrderForWx(scanPayReqDataDTO);
if (serviceResponse.isSuccess()) {
// 生成支付记录
BillingPayInfoDTO billingPayInfoDTO = new BillingPayInfoDTO();
......
......@@ -44,7 +44,7 @@
<dubbo:service interface="com.gic.enterprise.service.BillingOrderApiService" ref="billingOrderApiService" timeout="60000" />
<!--微信支付-->
<dubbo:reference interface="com.gic.thirdparty.api.service.Pay4WXService" id="pay4WXService" timeout="6000" />
<dubbo:reference interface="com.gic.thirdparty.api.service.Pay4WxService" id="pay4WxService" timeout="6000" />
<!--卡券-->
<dubbo:service interface="com.gic.enterprise.service.BillingCouponCardApiService" ref="billingCouponCardApiService" timeout="6000" />
......
......@@ -175,7 +175,7 @@
</set>
where page_id = #{pageId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.gic.enterprise.entity.TabAppletCustomPage">
<update id="updateByPrimaryKeyWithBlobs" parameterType="com.gic.enterprise.entity.TabAppletCustomPage">
update tab_applet_custom_page
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
title = #{title,jdbcType=VARCHAR},
......
......@@ -134,7 +134,7 @@
</set>
where component_id = #{componentId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.gic.enterprise.entity.TabAppletPageComponent">
<update id="updateByPrimaryKeyWithBlobs" parameterType="com.gic.enterprise.entity.TabAppletPageComponent">
update tab_applet_page_component
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
page_id = #{pageId,jdbcType=INTEGER},
......
......@@ -348,20 +348,20 @@ public class QrcodeController {
logger.warn("e", e1);
}
}
}).start();
});
}
private byte[] createFwhQrcode(Integer qrCodeId, int type, String appkey, Date endTime, String title, UserDetail userDetail){
ServiceResponse<String> qRcodeURL = null;
ServiceResponse<String> qRcodeUrl = null;
if(type == 1){
int expireSecond = Integer.valueOf((endTime.getTime() - System.currentTimeMillis())/1000+"");
qRcodeURL = this.weixinBaseFunService.getTemporaryQRcodeURL(appkey, qrCodeId + "", expireSecond);
qRcodeUrl = this.weixinBaseFunService.getTemporaryQRcodeURL(appkey, qrCodeId + "", expireSecond);
}else {
qRcodeURL = this.weixinBaseFunService.getQRcodeURL(appkey, qrCodeId + "");
qRcodeUrl = this.weixinBaseFunService.getQRcodeURL(appkey, qrCodeId + "");
}
if(qRcodeURL.isSuccess()){
return QrcodeUtils.createQrcode(qRcodeURL.getResult(), userDetail.getEnterpriseInfo().getLogo(), title);
if(qRcodeUrl.isSuccess()){
return QrcodeUtils.createQrcode(qRcodeUrl.getResult(), userDetail.getEnterpriseInfo().getLogo(), title);
}
return null;
}
......@@ -383,13 +383,13 @@ public class QrcodeController {
if(scenes.isSuccess() && scenes.getResult() != null){
List<QrcodeScenesDTO> result = scenes.getResult().getResult();
if(CollectionUtils.isNotEmpty(result)){
for(QrcodeScenesDTO dto1 : result){
if(dto.getId().intValue() == dto1.getScenesClassifyId().intValue()){
JSONObject scenesJSON = new JSONObject();
scenesJSON.put("id", dto1.getScenesId());
scenesJSON.put("name", dto1.getScenesName());
scenesJSON.put("children", this.getScenesValueData(dto1, valueResponse));
scenesArr.add(scenesJSON);
for(QrcodeScenesDTO scenesDTO : result){
if(dto.getId().intValue() == scenesDTO.getScenesClassifyId().intValue()){
JSONObject scenesJson = new JSONObject();
scenesJson.put("id", scenesDTO.getScenesId());
scenesJson.put("name", scenesDTO.getScenesName());
scenesJson.put("children", this.getScenesValueData(scenesDTO, valueResponse));
scenesArr.add(scenesJson);
}
}
}
......@@ -404,11 +404,11 @@ public class QrcodeController {
if(CollectionUtils.isNotEmpty(valueList)){
for(QrcodeScenesValueDTO valueDTO : valueList){
if(valueDTO.getScenesId().intValue() == dto1.getScenesId().intValue()){
JSONObject valueJSON = new JSONObject();
valueJSON.put("id", valueDTO.getValueId());
valueJSON.put("name", valueDTO.getName());
valueJSON.put("children", new JSONArray());
valueArr.add(valueJSON);
JSONObject valueJson = new JSONObject();
valueJson.put("id", valueDTO.getValueId());
valueJson.put("name", valueDTO.getName());
valueJson.put("children", new JSONArray());
valueArr.add(valueJson);
}
}
}
......
......@@ -121,17 +121,125 @@ public class DoubleCallingRecordController extends DownloadUtils {
}
private enum DoubleCallingFieldEnum{
/**
* 扣费时间
* @Title:
* @Description:
* @author taogs
* @param null
* @return
* @throws
*/
deductionTime("deductionTime", "扣费时间", 0),
/**
* 支付流水号
* @Title:
* @Description:
* @author taogs
* @param null
* @return
* @throws
*/
paySerialNumber("paySerialNumber", "支付流水号", 0),
/**
* 主叫名称
* @Title:
* @Description:
* @author taogs
* @param null
* @return
* @throws
*/
callerName("callerName", "主叫名称", 0),
/**
* 主叫号码
* @Title:
* @Description:
* @author taogs
* @param null
* @return
* @throws
*/
callerPhone("callerPhone", "主叫号码", 1),
/**
* 被叫号码
* @Title:
* @Description:
* @author taogs
* @param null
* @return
* @throws
*/
calledPhone("calledPhone", "被叫号码", 1),
/**
* 服务门店
* @Title:
* @Description:
* @author taogs
* @param null
* @return
* @throws
*/
storeName("storeName", "服务门店", 0),
/**
* 门店分组
* @Title:
* @Description:
* @author taogs
* @param null
* @return
* @throws
*/
storeGroupName("storeGroupName", "门店分组", 0),
/**
* 呼叫时间
* @Title:
* @Description:
* @author taogs
* @param null
* @return
* @throws
*/
callTime("callTime", "呼叫时间", 0),
/**
* 通话时间
* @Title:
* @Description:
* @author taogs
* @param null
* @return
* @throws
*/
voiceTime("voiceTime", "通话时间", 0),
/**
* 应用
* @Title:
* @Description:
* @author taogs
* @param null
* @return
* @throws
*/
appName("appName", "应用", 0),
/**
* 说明
* @Title:
* @Description:
* @author taogs
* @param null
* @return
* @throws
*/
remark("remark", "说明", 0),
/**
* 费用
* @Title:
* @Description:
* @author taogs
* @param null
* @return
* @throws
*/
fee("fee", "费用", 0),
;
private String fieldCode;
......
......@@ -122,21 +122,69 @@ public class InternationalSmsRecordController extends DownloadUtils {
}
private enum InternationalSmsFieldEnum {
/**
* 扣费时间
*/
deductionTime("deductionTime", "扣费时间", 0),
/**
* 国家(或地区)
*/
nation_code("nation_code", "国家(或地区)", 0),
/**
* 国家(或地区)码
*/
nation_name("nation_name", "国家(或地区)码", 0),
/**
* 支付流水号
*/
paySerialNumber("paySerialNumber", "支付流水号", 0),
/**
* 条数
*/
billNumber("billNumber", "条数", 0),
/**
* 费用
*/
fee("fee", "费用", 0),
/**
* 接收手机号
*/
receivePhone("receivePhone", "接收手机号", 1),
/**
* 会员卡
*/
memberCardName("memberCardName", "会员卡", 0),
/**
* 会员姓名
*/
memberName("memberName", "会员姓名", 0),
/**
* 服务门店
*/
storeName("storeName", "服务门店", 0),
/**
* 门店分组
*/
storeGroupName("storeGroupName", "门店分组", 0),
/**
* 店招品牌
*/
storeBrandName("storeBrandName", "店招品牌", 0),
/**
* 支付方式
*/
payType("payType", "支付方式", 0),
/**
* 应用
*/
appName("appName", "应用", 0),
/**
* 短信内容
*/
smsContent("smsContent", "短信内容", 0),
/**
* 操作人
*/
userName("userName", "操作人", 0),
;
private String fieldCode;
......
......@@ -121,18 +121,57 @@ public class RecordingStorageRecordController extends DownloadUtils {
}
private enum RecordingStorageFieldEnum{
/**
* 扣费时间
*/
deductionTime("deductionTime", "扣费时间", 0),
/**
* 支付流水号
*/
paySerialNumber("paySerialNumber", "支付流水号", 0),
/**
* 录音存储时长
*/
storageDuration("storageDuration", "录音存储时长", 0),
/**
* 主叫姓名
*/
callerName("callerName", "主叫姓名", 0),
/**
* 主叫号码
*/
callerPhone("callerPhone", "主叫号码", 1),
/**
* 被叫号码
*/
calledPhone("calledPhone", "被叫号码", 1),
/**
* 服务门店
*/
storeName("storeName", "服务门店", 0),
/**
* 门店分组
*/
storeGroupName("storeGroupName", "门店分组", 0),
/**
* 呼叫时间
*/
callTime("callTime", "呼叫时间", 0),
/**
* 通话时间
*/
voiceTime("voiceTime", "通话时间", 0),
/**
* 应用
*/
appName("appName", "应用", 0),
/**
* 说明
*/
remark("remark", "说明", 0),
/**
* 费用
*/
fee("fee", "费用", 0),
;
private String fieldCode;
......
......@@ -131,15 +131,45 @@ public class SmsPackageRecordController extends DownloadUtils {
}
private enum SmsPackageFieldEnum{
/**
* 扣费时间
*/
deductionTime("deductionTime", "扣费时间", 0),
/**
* 产品信息
*/
productName("productName", "产品信息", 0),
/**
* 单价
*/
itemFee("itemFee", "单价", 0),
/**
* 数量
*/
itemCount("itemCount", "数量", 0),
/**
* 应付金额
*/
totalFee("totalFee", "应付金额", 0),
/**
* 优惠方式
*/
discountTypeName("discountTypeName", "优惠方式", 0),
/**
* 优惠券名称
*/
cardName("cardName", "优惠券名称", 0),
/**
* 优惠金额
*/
cardAmount("cardAmount", "优惠金额", 0),
/**
* 实付金额
*/
paidFee("paidFee", "实付金额", 0),
/**
* 操作人
*/
operatorName("operatorName", "操作人", 0),
;
private String fieldCode;
......
......@@ -123,19 +123,58 @@ public class SmsRecordController extends DownloadUtils {
}
private enum SmsFieldEnum {
/**
* 扣费时间
*/
deductionTime("deductionTime", "扣费时间", 0),
/**
* 支付流水号
*/
paySerialNumber("paySerialNumber", "支付流水号", 0),
/**
* 条数
*/
billNumber("billNumber", "条数", 0),
fee("fee", "费用", 0),
/**
* 接收手机号
*/
receivePhone("receivePhone", "接收手机号", 1),
/**
* 会员卡
*/
memberCardName("memberCardName", "会员卡", 0),
/**
* 会员姓名
*/
memberName("memberName", "会员姓名", 0),
/**
* 服务门店
*/
storeName("storeName", "服务门店", 0),
/**
* 门店分组
*/
storeGroupName("storeGroupName", "门店分组", 0),
/**
* 店招品牌
*/
storeBrandName("storeBrandName", "店招品牌", 0),
/**
* 支付方式
*/
payType("payType", "支付方式", 0),
/**
* 应用
*/
appName("appName", "应用", 0),
/**
* 短信内容
*/
smsContent("smsContent", "短信内容", 0),
/**
* 操作人
*/
userName("userName", "操作人", 0),
;
private String fieldCode;
......
......@@ -121,13 +121,37 @@ public class VoiceCodeRecordController extends DownloadUtils {
}
private enum VoiceCodeFieldEnum{
/**
* 扣费时间
*/
deductionTime("deductionTime", "扣费时间", 0),
/**
* 支付流水号
*/
paySerialNumber("paySerialNumber", "支付流水号", 0),
/**
* 接收号码
*/
receivePhone("receivePhone", "接收号码", 1),
/**
* 应用
*/
appName("appName", "应用", 0),
/**
* 费用
*/
fee("fee", "费用", 0),
/**
* 会员姓名
*/
memberName("memberName", "会员姓名", 0),
/**
* 服务门店
*/
storeName("storeName", "服务门店", 0),
/**
* 门店分组
*/
storeGroupName("storeGroupName", "门店分组", 0),
;
private String fieldCode;
......
......@@ -607,6 +607,56 @@ public class WmStoreSyncController {
public void run() {
try {
if (oneAndOne) {
this.setOneAndOne();
} else {
RedissonClient redisClient = RedisUtil.getRedisClient();
RMap<String, String> rMap = redisClient.getMap(STORE_BRANCH_REDIS_KEY + enterpriseId);
StoreDTO headStore = storeApiService.getStoreById(enterpriseId, headerStoreId).getResult();
WeimobPhysicalStoreDTO wmPhysicalStoreDTO = getWeimobPhsicalStore(headStore);
//标志位,如果成功,则需要把总店下面的导购也同步一下
int valid = 0;
for (Map<Integer, String> row : data) {
String regionName = row.get(0);
String storeCode = row.get(1);
StoreRegionDTO storeRegion = getStoreRegion(enterpriseId, regionName);
if (storeRegion == null) {
rMap.put(regionName + "-" + storeCode, "门店域不存在");
continue;
}
StoreDTO storeDTO = getStoreByRegionAndCode(enterpriseId, storeRegion.getRegionId(), storeCode);
if (storeDTO == null) {
rMap.put(regionName + "-" + storeCode, "门店code不存在");
continue;
}
List<WeimobPhysicalStoreDTO> list = new ArrayList<>(1);
list.add(getWeimobPhsicalStore(storeDTO));
ServiceResponse<Void> wmResult = this.weimobStoreSiteService
.addWeimobVirtualStore(wmMallStoreId, enterpriseId, wmPhysicalStoreDTO, list);
LOGGER.info("微盟同步总店-分店返回结果:{}", JSON.toJSONString(wmResult));
if (!wmResult.isSuccess()) {
rMap.put(regionName + "-" + storeCode, wmResult.getMessage());
} else {
rMap.put(regionName + "-" + storeCode, "成功");
++valid;
List<Integer> tempStoreId = new ArrayList<>(1);
if (valid == 1 && !isBranch) {
//只执行一次总店导购的同步
tempStoreId.add(headerStoreId);
//新增企业侧日志
this.wmStoreSyncLogApiService.saveWmStoreSyncLog(Arrays.asList(headerStoreId), wmMallStoreId, 1, enterpriseId);
}
tempStoreId.add(storeDTO.getStoreId());
// 导购同步
clerkApiService.syncClerkToWeimob(wmMallStoreId, tempStoreId, enterpriseId);
}
}
}
} catch (Exception e) {
LOGGER.warn("微盟总店同步线程日志:{}", e.getMessage(), e);
}
}
private void setOneAndOne(){
RedissonClient redisClient = RedisUtil.getRedisClient();
RMap<String, String> rMap = redisClient.getMap(REDIS_KEY + enterpriseId);
for (Map<Integer, String> row : data) {
......@@ -654,9 +704,7 @@ public class WmStoreSyncController {
errorIds.append(entry.getKey()).append(GlobalInfo.FLAG_COMMA);
errorMessage.put(entry.getKey().toString(), entry.getValue());
}
//因为是一条一条处理,所以失败了,就不会有成功的,不用 导购同步逻辑
List<StoreDTO> hasSuccessStoreList = getStoreList(errorIds.toString(), enterpriseId);
hasSuccessStoreList.forEach(e -> rMap.put(e.getRegionId() + "-" + e.getStoreCode(),
errorMessage.get(storeDTO.getStoreInfoId().toString())));
......@@ -671,55 +719,6 @@ public class WmStoreSyncController {
}
}
} else {
RedissonClient redisClient = RedisUtil.getRedisClient();
RMap<String, String> rMap = redisClient.getMap(STORE_BRANCH_REDIS_KEY + enterpriseId);
StoreDTO headStore = storeApiService.getStoreById(enterpriseId, headerStoreId).getResult();
WeimobPhysicalStoreDTO wmPhysicalStoreDTO = getWeimobPhsicalStore(headStore);
//标志位,如果成功,则需要把总店下面的导购也同步一下
int valid = 0;
for (Map<Integer, String> row : data) {
String regionName = row.get(0);
String storeCode = row.get(1);
StoreRegionDTO storeRegion = getStoreRegion(enterpriseId, regionName);
if (storeRegion == null) {
rMap.put(regionName + "-" + storeCode, "门店域不存在");
continue;
}
StoreDTO storeDTO = getStoreByRegionAndCode(enterpriseId, storeRegion.getRegionId(), storeCode);
if (storeDTO == null) {
rMap.put(regionName + "-" + storeCode, "门店code不存在");
continue;
}
List<WeimobPhysicalStoreDTO> list = new ArrayList<>(1);
list.add(getWeimobPhsicalStore(storeDTO));
ServiceResponse<Void> wmResult = this.weimobStoreSiteService
.addWeimobVirtualStore(wmMallStoreId, enterpriseId, wmPhysicalStoreDTO, list);
LOGGER.info("微盟同步总店-分店返回结果:{}", JSON.toJSONString(wmResult));
if (!wmResult.isSuccess()) {
rMap.put(regionName + "-" + storeCode, wmResult.getMessage());
} else {
rMap.put(regionName + "-" + storeCode, "成功");
++valid;
List<Integer> tempStoreId = new ArrayList<>(1);
if (valid == 1 && !isBranch) {
//只执行一次总店导购的同步
tempStoreId.add(headerStoreId);
//新增企业侧日志
this.wmStoreSyncLogApiService.saveWmStoreSyncLog(Arrays.asList(headerStoreId), wmMallStoreId, 1, enterpriseId);
}
tempStoreId.add(storeDTO.getStoreId());
// 导购同步
clerkApiService.syncClerkToWeimob(wmMallStoreId, tempStoreId, enterpriseId);
}
}
}
} catch (Exception e) {
LOGGER.warn("微盟总店同步线程日志:{}", e.getMessage(), e);
}
}
private List<StoreDTO> getStoreList(String storeInfoIds, Integer enterpriseId) {
......
package com.gic.enterprise.web.qo;
import com.gic.commons.annotation.SkipNamingCheck;
import org.apache.commons.lang.StringUtils;
import java.io.Serializable;
......@@ -12,6 +13,7 @@ import java.util.List;
* @author taogs
* @date 2020/9/11 15:34
*/
@SkipNamingCheck
public class QrcodeQO implements Serializable {
private Integer h5 = 0;
private String appletIds;
......
......@@ -25,7 +25,7 @@ public class ExcelUtils {
private static final String XLS = "xls";
private static final String XLSX = "xlsx";
public static XSSFWorkbook getXSSFWorkbook(String sheetName, List<List<String>> everyLines, XSSFWorkbook wb) {
public static XSSFWorkbook getXssfWorkbook(String sheetName, List<List<String>> everyLines, XSSFWorkbook wb) {
if (CollectionUtils.isEmpty(everyLines)) {
return null;
}
......@@ -63,9 +63,9 @@ public class ExcelUtils {
for (int j = 0; j < everyLines.get(i).size(); j++) {
sheet.setColumnWidth(j, COLUMN_HEIGHT);
//将内容按顺序赋给对应的列对象
XSSFCell cell1 = row.createCell(j);
cell1.setCellValue(everyLines.get(i).get(j));
cell1.setCellStyle(style);
XSSFCell xssfCell = row.createCell(j);
xssfCell.setCellValue(everyLines.get(i).get(j));
xssfCell.setCellStyle(style);
}
}
return wb;
......@@ -77,11 +77,11 @@ public class ExcelUtils {
XSSFWorkbook workbook = new XSSFWorkbook(); // 创建工作簿对象
XSSFSheet sheet = workbook.createSheet(title); // 创建工作表
XSSFRow row1 = sheet.createRow(0);
row1.setZeroHeight(true);
XSSFCell cell1 = row1.createCell(0);
XSSFRow xssfRow = sheet.createRow(0);
xssfRow.setZeroHeight(true);
XSSFCell xssfCell = xssfRow.createCell(0);
if (StringUtils.isNotBlank(regionIdStr)) {
cell1.setCellValue(regionIdStr);
xssfCell.setCellValue(regionIdStr);
}
XSSFRow rowm = sheet.createRow(1); // 产生表格标题行
......@@ -175,10 +175,6 @@ public class ExcelUtils {
style.setFillPattern(CellStyle.SOLID_FOREGROUND);
return style;
}
/*
* 列头单元格样式
*/
private static XSSFCellStyle getColumnTopStyle(XSSFWorkbook workbook) {
// 设置字体
......@@ -220,47 +216,28 @@ public class ExcelUtils {
}
/*
* 列数据信息单元格样式
/**
* getStyle
* @Title: getStyle
* @Description:
* @author taogs
* @param workbook
* @return org.apache.poi.xssf.usermodel.XSSFCellStyle
* @throws
*/
private static XSSFCellStyle getStyle(XSSFWorkbook workbook) {
// 设置字体
XSSFFont font = workbook.createFont();
// 设置字体大小
// font.setFontHeightInPoints((short)10);
// 字体加粗
// font.setBoldweight(XSSFFont.BOLDWEIGHT_BOLD);
// 设置字体名字
font.setFontName("Courier New");
font.setColor(IndexedColors.RED.index);
// 设置样式;
XSSFCellStyle style = workbook.createCellStyle();
// 设置底边框;
style.setBorderBottom(XSSFCellStyle.BORDER_THIN);
// 设置底边框颜色;
// style.setBottomBorderColor(XSSFColor.BLACK.index);
// 设置左边框;
style.setBorderLeft(XSSFCellStyle.BORDER_THIN);
// 设置左边框颜色;
// style.setLeftBorderColor(XSSFColor.BLACK.index);
// 设置右边框;
style.setBorderRight(XSSFCellStyle.BORDER_THIN);
// 设置右边框颜色;
// style.setRightBorderColor(XSSFColor.BLACK.index);
// 设置顶边框;
style.setBorderTop(XSSFCellStyle.BORDER_THIN);
// 设置顶边框颜色;
// style.setTopBorderColor(XSSFColor.BLACK.index);
// 在样式用应用设置的字体;
style.setFont(font);
// 设置自动换行;
style.setWrapText(false);
// 设置水平对齐的样式为居中对齐;
style.setAlignment(XSSFCellStyle.ALIGN_CENTER);
// 设置垂直对齐的样式为居中对齐;
style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
return style;
}
......@@ -284,7 +261,7 @@ public class ExcelUtils {
* @return
*/
public static List<Map<Integer, String>> readExcel(int row, String fileType, Workbook xssfWorkbook, Map<Integer, Boolean> dateTypeMap) {
if (fileType.equals(XLSX)) {
if (XLSX.equals(fileType)) {
return readXlsx(xssfWorkbook, row, dateTypeMap);
} else {
return null;
......@@ -293,7 +270,7 @@ public class ExcelUtils {
public static List<Map<Integer, String>> readXlsx(Workbook xssfWorkbook, int row, Map<Integer, Boolean> dateTypeMap) {
List<Map<Integer, String>> result = new ArrayList<Map<Integer, String>>();
SimpleDateFormat format = new SimpleDateFormat(Constants.dateformat);
SimpleDateFormat format = new SimpleDateFormat(Constants.DATE_FORMAT);
// XSSFWorkbook xssfWorkbook = new XSSFWorkbook(in);
for (int numSheet = 0; numSheet < 1; numSheet++) {
Sheet xssfSheet = xssfWorkbook.getSheetAt(numSheet);
......
......@@ -40,8 +40,8 @@ public class QrcodeUtils {
Map<EncodeHintType, Object> hints = new HashMap<EncodeHintType, Object>();
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
try {
BufferedImage bim = getQR_CODEBufferedImage(url, BarcodeFormat.QR_CODE, WIDTH, HEIGHT, hints);
imageByte = addLogo_QRCode(bim, getPicByte(logoPic), logoName, format);
BufferedImage bim = getQrcodeBufferedImage(url, BarcodeFormat.QR_CODE, WIDTH, HEIGHT, hints);
imageByte = addLogoQrcode(bim, getPicByte(logoPic), logoName, format);
return imageByte;
} catch (Exception e) {
log.error(e.getMessage());
......@@ -84,7 +84,7 @@ public class QrcodeUtils {
* 图片后缀名
* @return
*/
private static byte[] addLogo_QRCode(BufferedImage bim, byte[] logoPic, String logoName, String format) {
private static byte[] addLogoQrcode(BufferedImage bim, byte[] logoPic, String logoName, String format) {
try {
/**
* 读取二维码图片,并构建绘图对象
......@@ -104,7 +104,6 @@ public class QrcodeUtils {
image.flush();
// image = outImage;
}
if (logoPic != null) {
/**
* 读取Logo图片
......@@ -171,7 +170,7 @@ public class QrcodeUtils {
* 设置参数
* @return
*/
private static BufferedImage getQR_CODEBufferedImage(String content, BarcodeFormat barcodeFormat, int width, int height,
private static BufferedImage getQrcodeBufferedImage(String content, BarcodeFormat barcodeFormat, int width, int height,
Map<EncodeHintType, ?> hints) {
MultiFormatWriter multiFormatWriter = null;
BitMatrix bm = null;
......
......@@ -58,7 +58,6 @@ public class DoubleCallingRecordVO implements Serializable {
/**
* 被叫
*/
// @NotBlank(message = "被叫名")
private String calledName;
/**
......
......@@ -154,9 +154,9 @@ public class EnterpriseSmsController {
page.setPageSize(Integer.MAX_VALUE);
ServiceResponse<Page<EnterpriseSmsSignDTO>> result = smsOuterApiService.listSmsSignByEid(enterpriseId, page);
if (result.isSuccess()) {
Page<EnterpriseSmsSignDTO> page1 = result.getResult();
if (page1 != null) {
List<EnterpriseSmsSignDTO> list = page1.getResult();
Page<EnterpriseSmsSignDTO> smsSignPage = result.getResult();
if (smsSignPage != null) {
List<EnterpriseSmsSignDTO> list = smsSignPage.getResult();
if (CollectionUtils.isNotEmpty(list)) {
//有一条数据就符合条件
return true;
......
......@@ -40,18 +40,6 @@ public class LinkController {
return ResultControllerUtils.commonResult(serviceResponse);
}
// @RequestMapping("/save-link-menu")
// public RestResponse saveLinkMenu(Integer parentId, String name, Integer type) {
// ServiceResponse<Void> serviceResponse = linkApiService.saveLinkMenu(parentId, name, type);
// return ResultControllerUtils.commonResult(serviceResponse);
// }
//
// @RequestMapping("/update-link-menu")
// public RestResponse updateLinkMenu(Integer linkId, String name, Integer type) {
// ServiceResponse<Void> serviceResponse = linkApiService.updateLinkMenu(linkId, name, type);
// return ResultControllerUtils.commonResult(serviceResponse);
// }
@RequestMapping("/save-link-child-menu")
public RestResponse saveLinkChildMenu(@Validated(LinkQO.LinkSaveValid.class) LinkQO linkQO) {
ServiceResponse<Void> serviceResponse = linkApiService.saveLinkChildMenu(EntityUtil.changeEntityByJSON(LinkDTO.class, linkQO));
......
......@@ -109,21 +109,21 @@ public class MqController {
@RequestMapping("/update-console")
public RestResponse updateConsole(Integer dispatchWorkerNum, Integer readWorkerNum, Integer checkWorkerNum, Integer readingMessageStopped) {
UpdateResponse updateResponse0 = mqConfigService.updateDispatchWorkerNum(dispatchWorkerNum);
if (!updateResponse0.isSuccess()) {
return RestResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), updateResponse0.getMessage());
UpdateResponse updateDispatchResponse = mqConfigService.updateDispatchWorkerNum(dispatchWorkerNum);
if (!updateDispatchResponse.isSuccess()) {
return RestResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), updateDispatchResponse.getMessage());
}
UpdateResponse updateResponse1 = mqConfigService.updateReadWorkerNum(readWorkerNum);
if (!updateResponse1.isSuccess()) {
return RestResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), updateResponse1.getMessage());
UpdateResponse updateReadResponse = mqConfigService.updateReadWorkerNum(readWorkerNum);
if (!updateReadResponse.isSuccess()) {
return RestResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), updateReadResponse.getMessage());
}
UpdateResponse updateResponse2 = mqConfigService.updateCheckWorkerNum(checkWorkerNum);
if (!updateResponse2.isSuccess()) {
return RestResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), updateResponse2.getMessage());
UpdateResponse updateCheckResponse = mqConfigService.updateCheckWorkerNum(checkWorkerNum);
if (!updateCheckResponse.isSuccess()) {
return RestResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), updateCheckResponse.getMessage());
}
UpdateResponse updateResponse3 = mqConfigService.stopReadingMessage(1 == readingMessageStopped);
if (!updateResponse3.isSuccess()) {
return RestResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), updateResponse3.getMessage());
UpdateResponse stopReadingResponse = mqConfigService.stopReadingMessage(1 == readingMessageStopped);
if (!stopReadingResponse.isSuccess()) {
return RestResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), stopReadingResponse.getMessage());
}
return RestResponse.success();
}
......
......@@ -35,13 +35,13 @@ public class ProvinceController {
return RestResponse.success();
}
List<String> result = new ArrayList<>();
ServiceResponse<List<ProvinceDTO>> serviceResponse = this.provincesApiService.selectAllProvince();
ServiceResponse<List<CityDTO>> serviceResponse1 = this.provincesApiService.selectAllCity();
ServiceResponse<List<CountyDTO>> serviceResponse2 = this.provincesApiService.selectAllCounty();
ServiceResponse<List<ProvinceDTO>> provinceResponse = this.provincesApiService.selectAllProvince();
ServiceResponse<List<CityDTO>> cityResponse = this.provincesApiService.selectAllCity();
ServiceResponse<List<CountyDTO>> countyResponse = this.provincesApiService.selectAllCounty();
String[] idArr = ids.split(",");
for (String id : idArr) {
if (serviceResponse.isSuccess()) {
List<ProvinceDTO> provinceDTOList = serviceResponse.getResult();
if (provinceResponse.isSuccess()) {
List<ProvinceDTO> provinceDTOList = provinceResponse.getResult();
for (ProvinceDTO provinceDTO : provinceDTOList) {
if (id.equals(provinceDTO.getProvinceId())) {
result.add(provinceDTO.getProvinceName());
......@@ -49,8 +49,8 @@ public class ProvinceController {
}
}
}
if (serviceResponse1.isSuccess()) {
List<CityDTO> cityDTOList = serviceResponse1.getResult();
if (cityResponse.isSuccess()) {
List<CityDTO> cityDTOList = cityResponse.getResult();
for (CityDTO cityDTO : cityDTOList) {
if (id.equals(cityDTO.getCityId())) {
result.add(cityDTO.getCityName());
......@@ -58,8 +58,8 @@ public class ProvinceController {
}
}
}
if (serviceResponse2.isSuccess()) {
List<CountyDTO> countyDTOList = serviceResponse2.getResult();
if (countyResponse.isSuccess()) {
List<CountyDTO> countyDTOList = countyResponse.getResult();
for (CountyDTO countyDTO : countyDTOList) {
if (id.equals(countyDTO.getCountyId())) {
result.add(countyDTO.getCountyName());
......
......@@ -63,9 +63,9 @@ public class ExcelUtils {
for (int j = 0; j < everyLines.get(i).size(); j++) {
sheet.setColumnWidth(j, COLUMN_HEIGHT);
//将内容按顺序赋给对应的列对象
XSSFCell cell1 = row.createCell(j);
cell1.setCellValue(everyLines.get(i).get(j));
cell1.setCellStyle(style);
XSSFCell xssfCell = row.createCell(j);
xssfCell.setCellValue(everyLines.get(i).get(j));
xssfCell.setCellStyle(style);
}
}
return wb;
......@@ -79,9 +79,9 @@ public class ExcelUtils {
XSSFRow row1 = sheet.createRow(0);
row1.setZeroHeight(true);
XSSFCell cell1 = row1.createCell(0);
XSSFCell xssfCell = row1.createCell(0);
if (StringUtils.isNotBlank(regionIdStr)) {
cell1.setCellValue(regionIdStr);
xssfCell.setCellValue(regionIdStr);
}
XSSFRow rowm = sheet.createRow(1); // 产生表格标题行
......@@ -282,7 +282,7 @@ public class ExcelUtils {
* @return
*/
public static List<Map<Integer, String>> readExcel(int row, String fileType, Workbook xssfWorkbook, Map<Integer, Boolean> dateTypeMap) {
if (fileType.equals(XLSX)) {
if (XLSX.equals(fileType)) {Map
return readXlsx(xssfWorkbook, row, dateTypeMap);
} else {
return null;
......@@ -291,7 +291,7 @@ public class ExcelUtils {
public static List<Map<Integer, String>> readXlsx(Workbook xssfWorkbook, int row, Map<Integer, Boolean> dateTypeMap) {
List<Map<Integer, String>> result = new ArrayList<Map<Integer, String>>();
SimpleDateFormat format = new SimpleDateFormat(Constants.dateformat);
SimpleDateFormat format = new SimpleDateFormat(Constants.DATE_FORMAT);
// XSSFWorkbook xssfWorkbook = new XSSFWorkbook(in);
for (int numSheet = 0; numSheet < 1; numSheet++) {
Sheet xssfSheet = xssfWorkbook.getSheetAt(numSheet);
......
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