Commit c3010711 by fudahua

同步优化初步2

parent 7fc0ca46
......@@ -47,7 +47,7 @@ public interface DepartmentApiService {
* @param department
* @return
*/
ServiceResponse add(DepartmentDTO department);
ServiceResponse<DepartmentDTO> add(DepartmentDTO department);
/**
* 修改部门
* @param department
......
package com.gic.haoban.manage.service.entity;
import java.io.Serializable;
import java.util.Date;
/**
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description:
*
* @author fdh
*/
public class TabHaobanPreDealLog implements Serializable {
/**
*
*/
private Integer id;
/**
* 企业微信id
*/
private String wxEnterpriseId;
/**
* 企业id
*/
private String enterpriseId;
/**
* 数据id
*/
private String dataId;
/**
* 父dataid
*/
private String pDataId;
/**
* 任务id
*/
private String taskId;
/**
* 数据类型 0 分组 1门店 2成员
*/
private Integer dataType;
/**
* 状态 0 未同步 1同步完成 2 同步失败
*/
private Integer statusFlag;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*/
private static final long serialVersionUID = 1L;
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
/**
* This method returns the value of the database column tab_haoban_pre_deal_log.id
*
* @return the value of tab_haoban_pre_deal_log.id
*/
public Integer getId() {
return id;
}
/**
* This method sets the value of the database column tab_haoban_pre_deal_log.id
*
* @param id the value for tab_haoban_pre_deal_log.id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method returns the value of the database column tab_haoban_pre_deal_log.wx_enterprise_id
*
* @return the value of tab_haoban_pre_deal_log.wx_enterprise_id
*/
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
/**
* This method sets the value of the database column tab_haoban_pre_deal_log.wx_enterprise_id
*
* @param wxEnterpriseId the value for tab_haoban_pre_deal_log.wx_enterprise_id
*/
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
/**
* This method returns the value of the database column tab_haoban_pre_deal_log.data_id
*
* @return the value of tab_haoban_pre_deal_log.data_id
*/
public String getDataId() {
return dataId;
}
/**
* This method sets the value of the database column tab_haoban_pre_deal_log.data_id
*
* @param dataId the value for tab_haoban_pre_deal_log.data_id
*/
public void setDataId(String dataId) {
this.dataId = dataId;
}
/**
* This method returns the value of the database column tab_haoban_pre_deal_log.p_data_id
*
* @return the value of tab_haoban_pre_deal_log.p_data_id
*/
public String getpDataId() {
return pDataId;
}
/**
* This method sets the value of the database column tab_haoban_pre_deal_log.p_data_id
*
* @param pDataId the value for tab_haoban_pre_deal_log.p_data_id
*/
public void setpDataId(String pDataId) {
this.pDataId = pDataId;
}
/**
* This method returns the value of the database column tab_haoban_pre_deal_log.task_id
*
* @return the value of tab_haoban_pre_deal_log.task_id
*/
public String getTaskId() {
return taskId;
}
/**
* This method sets the value of the database column tab_haoban_pre_deal_log.task_id
*
* @param taskId the value for tab_haoban_pre_deal_log.task_id
*/
public void setTaskId(String taskId) {
this.taskId = taskId;
}
/**
* This method returns the value of the database column tab_haoban_pre_deal_log.data_type
*
* @return the value of tab_haoban_pre_deal_log.data_type
*/
public Integer getDataType() {
return dataType;
}
/**
* This method sets the value of the database column tab_haoban_pre_deal_log.data_type
*
* @param dataType the value for tab_haoban_pre_deal_log.data_type
*/
public void setDataType(Integer dataType) {
this.dataType = dataType;
}
/**
* This method returns the value of the database column tab_haoban_pre_deal_log.status_flag
*
* @return the value of tab_haoban_pre_deal_log.status_flag
*/
public Integer getStatusFlag() {
return statusFlag;
}
/**
* This method sets the value of the database column tab_haoban_pre_deal_log.status_flag
*
* @param statusFlag the value for tab_haoban_pre_deal_log.status_flag
*/
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
/**
* This method returns the value of the database column tab_haoban_pre_deal_log.create_time
*
* @return the value of tab_haoban_pre_deal_log.create_time
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method sets the value of the database column tab_haoban_pre_deal_log.create_time
*
* @param createTime the value for tab_haoban_pre_deal_log.create_time
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method returns the value of the database column tab_haoban_pre_deal_log.update_time
*
* @return the value of tab_haoban_pre_deal_log.update_time
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* This method sets the value of the database column tab_haoban_pre_deal_log.update_time
*
* @param updateTime the value for tab_haoban_pre_deal_log.update_time
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
package com.gic.haoban.manage.service.entity;
import java.io.Serializable;
import java.util.Date;
/**
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description:
*
* @author fdh
*/
public class TabHaobanSyncTask implements Serializable {
/**
*
*/
private String taskId;
/**
*
*/
private String taskName;
/**
* 任务创建人
*/
private String addUser;
/**
* 任务描述
*/
private String taskDesc;
/**
* 任务状态
*/
private Integer statusFlag;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*/
private static final long serialVersionUID = 1L;
/**
* This method returns the value of the database column tab_haoban_sync_task.task_id
*
* @return the value of tab_haoban_sync_task.task_id
*/
public String getTaskId() {
return taskId;
}
/**
* This method sets the value of the database column tab_haoban_sync_task.task_id
*
* @param taskId the value for tab_haoban_sync_task.task_id
*/
public void setTaskId(String taskId) {
this.taskId = taskId;
}
/**
* This method returns the value of the database column tab_haoban_sync_task.task_name
*
* @return the value of tab_haoban_sync_task.task_name
*/
public String getTaskName() {
return taskName;
}
/**
* This method sets the value of the database column tab_haoban_sync_task.task_name
*
* @param taskName the value for tab_haoban_sync_task.task_name
*/
public void setTaskName(String taskName) {
this.taskName = taskName;
}
/**
* This method returns the value of the database column tab_haoban_sync_task.add_user
*
* @return the value of tab_haoban_sync_task.add_user
*/
public String getAddUser() {
return addUser;
}
/**
* This method sets the value of the database column tab_haoban_sync_task.add_user
*
* @param addUser the value for tab_haoban_sync_task.add_user
*/
public void setAddUser(String addUser) {
this.addUser = addUser;
}
/**
* This method returns the value of the database column tab_haoban_sync_task.task_desc
*
* @return the value of tab_haoban_sync_task.task_desc
*/
public String getTaskDesc() {
return taskDesc;
}
/**
* This method sets the value of the database column tab_haoban_sync_task.task_desc
*
* @param taskDesc the value for tab_haoban_sync_task.task_desc
*/
public void setTaskDesc(String taskDesc) {
this.taskDesc = taskDesc;
}
/**
* This method returns the value of the database column tab_haoban_sync_task.status_flag
*
* @return the value of tab_haoban_sync_task.status_flag
*/
public Integer getStatusFlag() {
return statusFlag;
}
/**
* This method sets the value of the database column tab_haoban_sync_task.status_flag
*
* @param statusFlag the value for tab_haoban_sync_task.status_flag
*/
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
/**
* This method returns the value of the database column tab_haoban_sync_task.create_time
*
* @return the value of tab_haoban_sync_task.create_time
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method sets the value of the database column tab_haoban_sync_task.create_time
*
* @param createTime the value for tab_haoban_sync_task.create_time
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method returns the value of the database column tab_haoban_sync_task.update_time
*
* @return the value of tab_haoban_sync_task.update_time
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* This method sets the value of the database column tab_haoban_sync_task.update_time
*
* @param updateTime the value for tab_haoban_sync_task.update_time
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
......@@ -8,6 +8,8 @@ import com.gic.haoban.manage.service.service.SyncTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* Created 2020/4/10.
*
......@@ -29,7 +31,12 @@ public class SyncTaskServiceImpl implements SyncTaskService {
@Override
public boolean updateTaskStatus(String taskId, int status) {
return false;
TabHaobanSyncTask tabHaobanSyncTask = new TabHaobanSyncTask();
tabHaobanSyncTask.setTaskId(taskId);
tabHaobanSyncTask.setStatusFlag(status);
tabHaobanSyncTask.setUpdateTime(new Date());
int i = syncTaskMapper.updateByPrimaryKeySelective(tabHaobanSyncTask);
return i >= 0;
}
@Override
......
......@@ -88,7 +88,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public ServiceResponse add(DepartmentDTO department) {
public ServiceResponse<DepartmentDTO> add(DepartmentDTO department) {
ServiceResponse hr = new ServiceResponse();
hr.setCode(1);
//调微信的新增接口
......
......@@ -186,12 +186,13 @@ public class DepartmentContoller extends WebBaseController{
department.setChainId(dto.getChainId() + Constant.ID_SEPARATOR + dto.getDepartmentId());
department.setIsStore(0);
department.setLevel(dto.getLevel() + 1);
ServiceResponse hr = departmentApiService.add(department);
ServiceResponse<DepartmentDTO> hr = departmentApiService.add(department);
if(hr.getCode() != 1){
return resultResponse(HaoBanErrCode.ERR_DEFINE, hr.getMessage(), null, hr.getMessage());
}
return resultResponse(HaoBanErrCode.ERR_1,hr.getResult());
DepartmentDTO departmentDTO = hr.getResult();
departmentDTO.setHasSonNode(false);
return resultResponse(HaoBanErrCode.ERR_1, departmentDTO);
}
......
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