Merge branch 'cc_20241125_fix_addoperationLog' into 'master'
Cc 20241125 fix addoperation log See merge request hangzhou/java/custom_zxjp!31
This commit is contained in:
@@ -29,7 +29,6 @@ public class OperationLogDAO {
|
||||
if (Objects.isNull(operationLogDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
operationLogDO.setCreateTime(new Date());
|
||||
operationLogMapper.insertSelective(operationLogDO);
|
||||
return operationLogDO.getId();
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.response.AuditInfoResponse;
|
||||
import com.cool.store.service.OperationLogService;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -177,16 +178,43 @@ public class OperationLogServiceImpl implements OperationLogService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchUpdateProcessed(List<OperationLogDO> operationLogs, Long audit, String userId, String reason) {
|
||||
List<OperationLogDO> operationLogList = new ArrayList<>();
|
||||
Boolean flag = Boolean.FALSE;
|
||||
Date createTime = new Date();
|
||||
Date updateTime = new Date();
|
||||
for (OperationLogDO operationLogDO : operationLogs) {
|
||||
operationLogDO.setUpdateTime(new Date());
|
||||
operationLogDO.setUpdateTime(updateTime);
|
||||
operationLogDO.setUpdateUserId(userId);
|
||||
operationLogDO.setStatus(OperationStatusEnum.PROCESSED.getCode());
|
||||
if (operationLogDO.getOperator().equals(userId)) {
|
||||
operationLogDO.setAuditResultId(audit);
|
||||
flag = Boolean.TRUE;
|
||||
}
|
||||
if (operationLogDO.getType().equals(OperationTypeEnum.OPERATION_TYPE_1.getCode())) {
|
||||
createTime = operationLogDO.getCreateTime();
|
||||
}
|
||||
operationLogDO.setRemarks(reason);
|
||||
operationLogList.add(operationLogDO);
|
||||
}
|
||||
if (!flag){
|
||||
OperationLogDO operationLogDO1 = operationLogList.get(0);
|
||||
OperationLogDO operationLogDO = new OperationLogDO();
|
||||
operationLogDO.setOperator(userId);
|
||||
operationLogDO.setAuditResultId(audit);
|
||||
operationLogDO.setRemarks(reason);
|
||||
operationLogDO.setShopId(operationLogDO1.getShopId());
|
||||
operationLogDO.setShopSubStage(operationLogDO1.getShopSubStage());
|
||||
operationLogDO.setShopSubStageStatus(operationLogDO1.getShopSubStageStatus());
|
||||
operationLogDO.setStatus(OperationStatusEnum.PROCESSED.getCode());
|
||||
operationLogDO.setType(OperationTypeEnum.OPERATION_TYPE_1.getCode());
|
||||
String userName = enterpriseUserDAO.getUserName(userId);
|
||||
if (StringUtils.isNotBlank(userName)) {
|
||||
operationLogDO.setOperatorName(userName);
|
||||
}
|
||||
operationLogDO.setCreateTime(createTime);
|
||||
operationLogDO.setUpdateTime(updateTime);
|
||||
operationLogDO.setCreateUserId(userId);
|
||||
operationLogDAO.addOperationLog(operationLogDO);
|
||||
}
|
||||
return operationLogDAO.batchUpdateByPrimaryKeySelective(operationLogList);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user