Commit 863a132b by qwmqiuwenmin

Merge branch 'developer' of http://115.159.76.241/haoban3.0/haoban-manage3.0.git into developer

parents d02be358 24c2b2ad
......@@ -76,12 +76,23 @@ public interface PreDealLogMapper {
/**
* 统计任务数量
*
*listRebuildByTaskId
* @param taskId
* @return
*/
public int countByTaskId(@Param("taskId") String taskId, @Param("dataType") int dataType, @Param("status") int status);
/**
* 统计任务数量
* countExcepAndPreByTaskId
*
* @param taskId
* @return
*/
public int countExcepAndPreByTaskId(@Param("taskId") String taskId, @Param("dataType") int dataType);
/**
* 重试的时候 第一级部门
*
......@@ -90,4 +101,12 @@ public interface PreDealLogMapper {
*/
public List<TabHaobanPreDealLog> listRebuildDepartByTaskId(@Param("taskId") String taskId);
/**
* 统计重试任务数量
*
* @param taskId
* @return
*/
public List<TabHaobanPreDealLog> listRebuildByTaskId(@Param("taskId") String taskId, @Param("dataType") int dataType);
}
\ No newline at end of file
......@@ -64,7 +64,7 @@ public interface PreDealService {
public List<TabHaobanPreDealLog> listByTaskId(String taskId, int dataType, int status);
/**
* 获取任务数量
* 获取错误任务数量
*
* @param status
* @return
......@@ -72,10 +72,25 @@ public interface PreDealService {
public int countByTaskId(String taskId, int dataType, int status);
/**
* 获取任务数量
*
* @return
*/
public int countExcepAndPreByTaskId(String taskId, int dataType);
/**
* 获取重试时 需要处理的数据
*
* @param taskId
* @return
*/
public List<TabHaobanPreDealLog> queryDepartRebuildDealLog(String taskId);
/**
* 获取重试任务列表
*
* @param status
* @return
*/
public List<TabHaobanPreDealLog> listRebuildByTaskId(String taskId, int dataType);
}
......@@ -64,7 +64,17 @@ public class PreDealServiceImpl implements PreDealService {
}
@Override
public int countExcepAndPreByTaskId(String taskId, int dataType) {
return preDealLogMapper.countExcepAndPreByTaskId(taskId, dataType);
}
@Override
public List<TabHaobanPreDealLog> queryDepartRebuildDealLog(String taskId) {
return preDealLogMapper.listRebuildDepartByTaskId(taskId);
}
@Override
public List<TabHaobanPreDealLog> listRebuildByTaskId(String taskId, int dataType) {
return preDealLogMapper.listRebuildByTaskId(taskId, dataType);
}
}
......@@ -130,8 +130,18 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
@Override
public void reDealDepartment(String taskId, int dataType) {
int groupErrCount = preDealService.countByTaskId(taskId, PreDealTypeEnum.group.getVal(), PreDealStatusEnum.exception.getVal());
int storeErrCount = preDealService.countByTaskId(taskId, PreDealTypeEnum.store.getVal(), PreDealStatusEnum.exception.getVal());
TabHaobanSyncTask task = syncTaskService.getSyncTask(taskId);
if (null == task) {
logger.info("任务不存在!{}", taskId);
return;
}
if ((!task.getStatusFlag().equals(SyncTaskStatusEnum.exception_close.getVal())) &&
(!task.getStatusFlag().equals(SyncTaskStatusEnum.exception_compute.getVal()))) {
logger.info("任务不在没有在异常状态!{}", taskId);
return;
}
int groupErrCount = preDealService.countExcepAndPreByTaskId(taskId, PreDealTypeEnum.group.getVal());
int storeErrCount = preDealService.countExcepAndPreByTaskId(taskId, PreDealTypeEnum.store.getVal());
List<TabHaobanPreDealLog> list = null;
if (dataType == -1) {
if (groupErrCount > 0) {
......@@ -139,10 +149,10 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
list = preDealService.queryDepartRebuildDealLog(taskId);
} else if (storeErrCount > 0) {
dataType = PreDealTypeEnum.store.getVal();
list = preDealService.listByTaskId(taskId, dataType, PreDealStatusEnum.exception.getVal());
list = preDealService.listRebuildByTaskId(taskId, dataType);
} else {
dataType = PreDealTypeEnum.clerk.getVal();
list = preDealService.listByTaskId(taskId, dataType, PreDealStatusEnum.exception.getVal());
list = preDealService.listRebuildByTaskId(taskId, dataType);
}
}
if (CollectionUtils.isEmpty(list)) {
......
......@@ -439,7 +439,7 @@ public class StaffApiServiceImpl implements StaffApiService {
logger.info("clerkDto:{}", JSONObject.toJSONString(clerkDTO));
String headPic = staffDTO.getHeadImg();
if(clerkDTO != null && (StringUtils.isNotBlank(staffName) && !clerkDTO.getClerkName().equals(staffName) || !staffDTO.getPhoneNumber().equals(clerkDTO.getPhoneNumber()))
|| (org.apache.commons.lang3.StringUtils.isNotBlank(headPic) && !headPic.equals(clerkDTO.getImageUrl()))
|| (org.apache.commons.lang3.StringUtils.isNotBlank(headPic) && !headPic.equals(clerkDTO.getHeadImgUrl()))
|| !staffDTO.getSex().equals(clerkDTO.getClerkGender())){
logger.info("【员工修改】clerkDTO={}",JSON.toJSONString(clerkDTO));
clerkDTO.setClerkName(staffDTO.getStaffName());
......
......@@ -76,6 +76,9 @@ public class StoreSyncOperation implements BaseSyncOperation {
TabHaobanDepartment pParentDepartment = departmentService.selectByRelatedId(dataPre.getpDataId());
if (null == pParentDepartment) {
pParentDepartment = departmentService.selectById(dataPre.getpDataId());
}
if (null == pParentDepartment) {
logger.info("不存在该父部门:c:{},p:{}", dataPre.getDataId(), dataPre.getpDataId());
return;
}
......
......@@ -210,6 +210,18 @@
</if>
</select>
<select id="countExcepAndPreByTaskId" resultType="Integer">
select
COUNT(*)
from tab_haoban_pre_deal_log
where task_id = #{taskId}
<if test="dataType!=-1">
and data_type=#{dataType}
</if>
and status_flag in(0,3)
</select>
<select id="listRebuildDepartByTaskId" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
......@@ -218,7 +230,7 @@
WHERE
a.task_id = #{taskId}
AND data_type = 0
AND status_flag = 3
AND status_flag in(0,3)
AND EXISTS (
SELECT
1
......@@ -231,4 +243,13 @@
AND b.status_flag = 2
)
</select>
<select id="listRebuildByTaskId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_pre_deal_log
where task_id = #{taskId} and data_type=#{dataType}
and status_flag in(0,3)
</select>
</mapper>
\ No newline at end of file
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