Commit 4bc4a57e by fudahua

同步优化初步3-同步成员

parent 248b0a0a
......@@ -24,7 +24,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/test")
public class SyncDealContoller extends WebBaseController {
private static Logger logger = LoggerFactory.getLogger(SyncDealContoller.class);
......@@ -33,9 +32,9 @@ public class SyncDealContoller extends WebBaseController {
private DealSyncOperationApiService dealSyncOperationApiService;
@RequestMapping("department-sync")
@RequestMapping("/test/department-sync")
@ResponseBody
public HaobanResponse departmentBatchSync(@RequestBody SyncDealQO qo, String wxEid) {
public HaobanResponse departmentBatchSyncTest(@RequestBody SyncDealQO qo, String wxEid) {
String task = null;
if (StringUtils.isNotBlank(wxEid)) {
task = dealSyncOperationApiService.createTask("门店同步", "11111", "部门同步");
......@@ -55,13 +54,26 @@ public class SyncDealContoller extends WebBaseController {
}
@RequestMapping("department-batch-sync-success")
public HaobanResponse syncSuccess(String syncKey) {
if (RedisUtil.getCache(syncKey) == null) {
return resultResponse(HaoBanErrCode.ERR_1, true);
@RequestMapping("/department-sync")
@ResponseBody
public HaobanResponse departmentBatchSync(@RequestBody SyncDealQO qo, String wxEid) {
String task = null;
if (StringUtils.isNotBlank(wxEid)) {
task = dealSyncOperationApiService.createTask("门店同步", "11111", "部门同步");
dealSyncOperationApiService.dealDepartment(task, wxEid, qo.getAddDepartment(), qo.getEditDepartment());
} else {
return resultResponse(HaoBanErrCode.ERR_1, false);
LoginVO login = (LoginVO) AuthRequestUtil.getSessionUser();
String wxEnterpriseId = login.getWxEnterpriseId();
String key = "haoban-sync-department-" + wxEnterpriseId;
if (RedisUtil.getCache(key) != null) {
return resultResponse(HaoBanErrCode.ERR_10011);
}
task = dealSyncOperationApiService.createTask("门店同步", login.getStaffDTO().getStaffId(), "部门同步");
dealSyncOperationApiService.dealDepartment(task, login.getWxEnterpriseId(), qo.getAddDepartment(), qo.getEditDepartment());
}
return resultResponse(HaoBanErrCode.ERR_1, task);
}
......
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