Merge remote-tracking branch 'origin/cc_20250325_select' into cc_20250325_select

This commit is contained in:
shuo.wang
2025-04-09 16:56:50 +08:00
27 changed files with 849 additions and 39 deletions

View File

@@ -1,7 +1,7 @@
package com.cool.store.controller.webb;
import com.cool.store.dto.StatusRefreshDTO;
import com.cool.store.response.ResponseResult;
import com.cool.store.response.bigdata.ApiResponse;
import com.cool.store.service.OpenApiService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
@@ -24,8 +24,8 @@ public class OpenApiController {
OpenApiService openApiService;
@GetMapping("/statusRefresh")
public ResponseResult<Boolean> statusRefresh(StatusRefreshDTO statusRefreshDTO){
return ResponseResult.success(openApiService.statusRefresh(statusRefreshDTO));
public ApiResponse<Boolean> statusRefresh(StatusRefreshDTO statusRefreshDTO){
return ApiResponse.success(openApiService.statusRefresh(statusRefreshDTO));
}
}

View File

@@ -243,4 +243,19 @@ public class PCTestController {
return ResponseResult.success(syncDataService.getData(shopId, DownSystemTypeEnum.getByCode(type)));
}
@Resource
ShopAccountDAO shopAccountDAO;
@Resource
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
@GetMapping("/initShopAccount")
@ApiOperation("初始化门店账号")
public ResponseResult<Integer> initShopAccount(@RequestParam(value = "partnerId", required = true) String partnerId,
@RequestParam(value = "shopId", required = true) Long shopId) {
// 调用第三方接口
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(partnerId);
return ResponseResult.success(shopAccountDAO.initShopAccount(hyPartnerUserInfoDO,Arrays.asList(shopId)));
}
}

View File

@@ -1,15 +1,20 @@
package com.cool.store.controller.webb;
import com.cool.store.dto.AccountAuditDTO;
import com.cool.store.dto.AccountEntryStatusAuditDTO;
import com.cool.store.dto.GetAccessTokenDTO;
import com.cool.store.dto.ShopAccount.ShopAccountDTO;
import com.cool.store.dto.AccountEntryStatusChangeDTO;
import com.cool.store.enums.DownSystemTypeEnum;
import com.cool.store.request.ZxjpApiRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.PushService;
import com.cool.store.service.ShopAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@@ -28,6 +33,8 @@ public class ShopAccountController {
@Resource
ShopAccountService accountService;
@Resource
PushService pushService;
@ApiOperation("根据门店shopId查询平台账号")
@GetMapping("/getShopAccountByShopId")
@@ -35,5 +42,55 @@ public class ShopAccountController {
return ResponseResult.success(accountService.getShopAccountByShopId(shopId));
}
@ApiOperation("根据门店shopId与平台名称查询数据")
@GetMapping("/getData")
public ResponseResult<ZxjpApiRequest> getData(@RequestParam(value = "shopId", required = true) Long shopId,
@RequestParam(value = "systemName", required = true) DownSystemTypeEnum systemName) {
return ResponseResult.success(accountService.getData(shopId,systemName));
}
@ApiOperation("开通状态审核")
@PostMapping("/auditAccount")
public ResponseResult<Boolean> auditAccount(@RequestBody @Validated AccountAuditDTO accountAuditDTO) {
return ResponseResult.success(accountService.auditAccount(accountAuditDTO));
}
@ApiOperation("推送数据")
@PostMapping("/pushData")
public ResponseResult<Boolean> pushData(@RequestBody @Validated AccountAuditDTO accountAuditDTO) {
return ResponseResult.success(accountService.pushData(accountAuditDTO));
}
@ApiOperation("进件状态审核")
@PostMapping("/accountEntryStatusAudit")
public ResponseResult<Boolean> accountEntryStatusAudit(@RequestBody @Validated AccountEntryStatusAuditDTO dto) {
return ResponseResult.success(accountService.accountEntryStatusAudit(dto));
}
@ApiOperation("进件状态修改")
@PostMapping("/accountEntryStatusChange")
public ResponseResult<Boolean> accountEntryStatusChange(@RequestBody @Validated AccountEntryStatusChangeDTO dto) {
return ResponseResult.success(accountService.accountEntryStatusChange(dto));
}
@ApiOperation("获取云流水免登token")
@PostMapping("/getYlsToken")
public ResponseResult<String> getYlsToken(@RequestBody @Validated GetAccessTokenDTO dto) {
return ResponseResult.success(pushService.getYlsToken(dto));
}
@ApiOperation("获取POS免登token")
@PostMapping("/getPosToken")
public ResponseResult<String> getPosToken(@RequestBody @Validated GetAccessTokenDTO dto) {
return ResponseResult.success(pushService.getPosToken(dto));
}
@ApiOperation("获取新掌柜免登token")
@PostMapping("/getXzgToken")
public ResponseResult<String> getXzgToken(@RequestBody @Validated GetAccessTokenDTO dto) {
return ResponseResult.success(pushService.getXzgToken(dto));
}
}

View File

@@ -0,0 +1,43 @@
package com.cool.store.controller.webc;
import com.cool.store.dto.ModifyPasswordDTO;
import com.cool.store.dto.ShopAccount.ShopAccountDTO;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.ShopAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2025/4/8 16:17
* @Version 1.0
*/
@RestController
@Api(tags ="小程序账号管理")
@RequestMapping({"/mini/account"})
public class MiniShopAccountController {
@Resource
ShopAccountService accountService;
@ApiOperation("根据门店shopId查询平台账号")
@GetMapping("/getShopAccountByShopId")
public ResponseResult<List<ShopAccountDTO>> getShopAccountByShopId(@RequestParam(value = "shopId", required = true) Long shopId) {
return ResponseResult.success(accountService.getShopAccountByShopId(shopId));
}
@ApiOperation("修改密码")
@GetMapping("/modifyPassword")
public ResponseResult<Boolean> modifyPassword(@RequestBody ModifyPasswordDTO request) {
return ResponseResult.success(accountService.modifyPassword(request));
}
}

View File

@@ -101,6 +101,8 @@ public class XxlJobHandler {
ApplyLicenseMapper applyLicenseMapper;
@Resource
private TallyBookService tallyBookService;
@Resource
ShopAccountDAO accountDAO;
@@ -337,5 +339,45 @@ public class XxlJobHandler {
}
}
@XxlJob("rePush")
public void rePush() {
log.info("------start rePush------");
boolean hasNext = true;
int pageNum = 1;
int pageSize = 10;
List<Long> shopIdList = new ArrayList<>();
while (hasNext) {
PageHelper.startPage(pageNum, pageSize);
//获取成功开店的门店
List<ShopAccountDO> accountDOS = accountDAO.getALlFail();
if (CollectionUtils.isEmpty(accountDOS)) {
log.info("------rePush is empty------");
break;
}
for (ShopAccountDO accountDO : accountDOS){
try {
// TODO: 2025/4/8 suzhuhong_
//推送数据 如果云流水或者新掌柜其中一个失败了 还要不要推送数据
//如果是POS推送成功 修改状态 还要修改阶段数据
//云流水 新掌柜 等待回调
}catch (Exception e){
}
}
if (accountDOS.size() < pageSize){
hasNext = false;
}
pageNum++;
}
}
}

View File

@@ -83,7 +83,7 @@ enterprise.dingCorpId=wpayJeDAAAhGIFgUJpJN-zg39JuNbYhg
##qywx.task.notice.url1=https://tstore-api.coolstore.cn/notice?corpId=%s&appType=%s&target=%s
qywx.task.notice.url2=https://tstore-h5.coolstore.cn/?corpId=%s&appType=%s#/notice?target=%s&noticeType=zx&corpId=%s&appType=%s&eid=%s
#机会点
#机会点地址
third.party.appKey=IGSAEQoakR2HEaYx
third.party.appSecret=aPsA99K1obFeFm3m
zx.opportunity.url=https://snp.wenmatech.com/
@@ -93,9 +93,25 @@ zx.big.data.url=https://ds.zhengxinfood.com/
zx.big.data.appKey=ff203b5567744feaaae49fb86f58c5bf
zx.big.data.appSecret=35b8b9a400b4430fa022190be0913cd6
#火吗POS
api.auth.url=https://api.zhengxindzg.cn
api.auth.username=GkqgAhUJ7p9swJo
api.auth.secret=NzVrnS3OWiupdDY
#新管家账号
xgj.api.auth.url=****
xgj.api.auth.username=****
xgj.api.auth.secret=****
#云流水账号
yls.api.auth.url=****
yls.api.auth.username=****
yls.api.auth.secret=****
#新掌柜账号
xzg.api.auth.url=****
xzg.api.auth.username=****
xzg.api.auth.secret=****
cool.api.appKey=123
cool.api.secret=123