feat:平台账号
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.dto.AccountAuditDTO;
|
||||
import com.cool.store.dto.AccountEntryStatusAuditDTO;
|
||||
import com.cool.store.dto.ShopAccount.ShopAccountDTO;
|
||||
import com.cool.store.dto.yun.AccountEntryStatusChangeDTO;
|
||||
import com.cool.store.enums.DownSystemTypeEnum;
|
||||
import com.cool.store.request.ZxjpApiRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
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;
|
||||
@@ -35,5 +38,37 @@ 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 = "shopId", required = true) DownSystemTypeEnum systemName) {
|
||||
return ResponseResult.success(accountService.getData(shopId,systemName));
|
||||
}
|
||||
|
||||
@ApiOperation("开通状态审核")
|
||||
@PostMapping("/auditAccount")
|
||||
public ResponseResult<Boolean> getData(@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> getDaa(@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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user